Using a graphics library - GD Library or ImageMagick

Started by hilti, July 04, 2011, 10:10:29 PM

Previous topic - Next topic

hilti

Hi Guys!



I'm currently working part-time on a visual search project written in newLISP. Now it's time to scale some images.



Does anyone have experiences in accessing GDLib or ImageMagick?

A full example including picture upload, scaling and saving to disk would be great. :-)



Thanks so much!

Hilti
--()o Dragonfly web framework for newLISP

http://dragonfly.apptruck.de\">http://dragonfly.apptruck.de

TedWalther

#1
Is Dragonfly the newLISP equivalent of Ruby on Rails?  Is your template system based on HAML/YAML?
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence.  Nine months later, they left with a baby named newLISP.  The women of the ivory towers wept and wailed.  \"Abomination!\" they cried.

hilti

#2
Hi Ted!



Dragonfly is a web framework for newLISP, although not as "magical" as Ruby on Rails. Template markup languages like HAML aren't currently supported.



The templating system is pretty basic, e.g.


<html><title><% (print "This is my title") %></title> ...
--()o Dragonfly web framework for newLISP

http://dragonfly.apptruck.de\">http://dragonfly.apptruck.de

TedWalther

#3
To answer your original question, so far I've used imagemagic using (exec) to use the commandline utilities.  I never got much traction with the C libraries themselves, so haven't made any newlisp modules for them.  I agree, it would be very nice to have such modules.
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence.  Nine months later, they left with a baby named newLISP.  The women of the ivory towers wept and wailed.  \"Abomination!\" they cried.

TedWalther

#4
Instead of HAML, what if we used HNML?  It is a sort of pun; instead of being pronounced "hamel", it would be "hanimal".  It would execute newlisp instead of ruby code.  But also, instead of python indentation, it would use sexps.  Or something sexp-ish.



And I have to know; I have seen some similar concepts in dragonfly and RoR.  Was dragonfly inspired a lot by Ruby on Rails, or just a little bit?
Cavemen in bearskins invaded the ivory towers of Artificial Intelligence.  Nine months later, they left with a baby named newLISP.  The women of the ivory towers wept and wailed.  \"Abomination!\" they cried.

hilti

#5
Dragonfly was inspired by different frameworks we've (Greg and I) came across in the last years.



Here's my short bio from http://www.rundragonfly.com/about">//http://www.rundragonfly.com/about ;-)


QuoteMarc Hildmann is a web developer since 1998, started writing apps in pure PHP, tried a little bit Ruby on Rails, experimented with some PHP Frameworks like Codeigniter and finally discovered newLISP. He's interested in retro-computing, especially the first XEROX machines and the good old SGI Indy.


But one last thing:

Deployment in Dragonfly is much easier than in Rails. ;-)

Rails Deployment is pain. Really pain.
--()o Dragonfly web framework for newLISP

http://dragonfly.apptruck.de\">http://dragonfly.apptruck.de

hilti

#6
Quote from: "TedWalther"To answer your original question, so far I've used imagemagic using (exec) to use the commandline utilities.


That's the way I do it right now, too. Feels a bit unreliable to me.



How Do I start in writing C-Bindings for imagemagick - I didn't find any docs about it?!
--()o Dragonfly web framework for newLISP

http://dragonfly.apptruck.de\">http://dragonfly.apptruck.de

Lutz

#7
There is a chapter about importing C-library functions in the CodePatterns document:



http://www.newlisp.org/downloads/CodePatterns.html#toc-23">http://www.newlisp.org/downloads/CodePa ... tml#toc-23">http://www.newlisp.org/downloads/CodePatterns.html#toc-23



And shorter documentation in the Users Manual and Reference:



http://www.newlisp.org/downloads/newlisp_manual.html#importing_libraries">http://www.newlisp.org/downloads/newlis ... _libraries">http://www.newlisp.org/downloads/newlisp_manual.html#importing_libraries



... each of the functions in that list says something which could be important when importing C-library functions.



There are also several standard modules using C-libraries:



http://www.newlisp.org/code/modules/crypto.lsp.html">http://www.newlisp.org/code/modules/crypto.lsp.html



http://www.newlisp.org/code/modules/gmp.lsp.html">http://www.newlisp.org/code/modules/gmp.lsp.html



http://www.newlisp.org/code/modules/mysql.lsp.html">http://www.newlisp.org/code/modules/mysql.lsp.html



http://www.newlisp.org/code/modules/odbc.lsp.html">http://www.newlisp.org/code/modules/odbc.lsp.html



http://www.newlisp.org/code/modules/postgres.lsp.html">http://www.newlisp.org/code/modules/postgres.lsp.html



http://www.newlisp.org/code/modules/sqlite3.lsp.html">http://www.newlisp.org/code/modules/sqlite3.lsp.html



http://www.newlisp.org/code/modules/unix.lsp.html">http://www.newlisp.org/code/modules/unix.lsp.html



http://www.newlisp.org/code/modules/zlib.lsp.html">http://www.newlisp.org/code/modules/zlib.lsp.html



... reading and understanding relevant code is always a big help.





An OpenGL example (has callbacks!)



http://www.newlisp.org/syntax.cgi?downloads/OpenGL/opengl-demo-lsp.txt">http://www.newlisp.org/syntax.cgi?downl ... mo-lsp.txt">http://www.newlisp.org/syntax.cgi?downloads/OpenGL/opengl-demo-lsp.txt



For ImageMagic and GD you would need the developer docs for C-programmers, to see how functions are called, what data types they take, etc.



You definitely need to know how to program in C or get somebody to help you, who knows.