Jump to content


Photo

Best way to access image magick


  • Please log in to reply
4 replies to this topic

#1 Jak

Jak
  • Members
  • PipPip
  • Member
  • 24 posts

Posted 07 October 2006 - 10:36 PM

Hi,
I was just wondering if there was a "best practice" when it comes to using ImageMagick through PHP. Ive been using MagickWand on my local server, but my hosts dont support it, so i was wondering what the best alternative is really. Is there a standard class that everyone uses, or does everyone just write their own class / functions that directly access exec()?

Thanks,
Jack
Jack

#2 printf

printf
  • Staff Alumni
  • Advanced Member
  • 889 posts

Posted 07 October 2006 - 10:55 PM

It depends on the server type you will be running under. While on Linux any of the PHP Program Execution functions work great, on Windows I tend to favor COM based program execution, because I can control STDIN, STDOUT and STDERR, which is great when running intense image manipulation functions in ImageMagick or any of program where you need real time forking, (running multi processes concurrently) without having to wait within your script, on each process. Sure it not really forking, but it as close as you will get in a windows scripting environment.


me!

#3 Jak

Jak
  • Members
  • PipPip
  • Member
  • 24 posts

Posted 07 October 2006 - 11:03 PM

Hmmm, thats kinda all a bit over my head, all i know is im running windows to test and linux on the production server. So would you reccomend me writing my own class, or are there good ones out there that take care of all the usuall requirements?

Cheers,
Jack

P.S. Did you have any luck with that imap thing with the UIDLs?
Jack

#4 printf

printf
  • Staff Alumni
  • Advanced Member
  • 889 posts

Posted 07 October 2006 - 11:33 PM

Hi Jak

I would say to create your own. The reason why is because the ones that I have seen are just centered on certain functions within ImageMagick so they will be very limited. By limited I mean they do a set task, like make thumbnails with water maker of other tasks associated with the thumbnail class. So trying to fit that into your project may not be best because you might not need that functionality!

One class I use a lot is Pear Image_3D but like all the other classes it centered on rendering, in this case 3D rendering, not on giving a common interface to access ImageMagick functions! One special note, I noticed if you download the Perl package of ImageMagick, you will have a lot of examples that are easy to convert from Perl to PHP, way more examples than that are in the PHP package. If you do that and need help with converting any, just ask, I'll be glad to help you.


me!

#5 Jak

Jak
  • Members
  • PipPip
  • Member
  • 24 posts

Posted 08 October 2006 - 12:05 AM

Cheers thats really helpful, very much appreicated.
Jack




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users