Page 1 of 1

Which should we be using for new PHP development?

Posted: 2007-08-08T07:49:14-07:00
by ridera
We need help understanding the merits and future plans for the three Imagemagick PHP programming approaches.

We have a fair bit of experience using the basic IM commands with PHP's exec(). This approach is a bit tedious getting the command syntax exactly correct every time.

However, on the API page, and I recall reading somewhere on the IM site, the developers recommend using one of the 2 PHP API interfaces. So, we began learning the two suggested to see which would serve our needs best.

IM's API page states: "a native PHP-extension to the ImageMagick MagickWand API". Well, it is and isn't. It's not documented in the PHP manual; but. rather on MagickWand's website. The documentation is quite meager; basically, it only provides the function name. User notes, like PHP's on-line manual would be extremely helpful.

However, we just found MagickWand's latest release was not compatible with IM's latest release 6.3.5. This creates a hell of a dilemma. It means you can't update IM without worrying about screwing up operational websites.

Next, on IM's API page we found "is a native PHP extension to create and modify images using the ImageMagick API. Documentation for the extension is available here." Sounded good till we saw on the PHP manual "Imagick Image Library" page "may change without notice in a future release of PHP. Use this extension at your own risk"

Hence, our question: Which should we be using for new PHP development? It appears PHP org is headed towards the classes Imagick Image Library; but, when?

All comments would be greatly appreciated.......

Re: Which should we be using for new PHP development?

Posted: 2007-08-13T23:14:13-07:00
by anthony
I compiled an apache and SunONe web servers to use all three interfaces. and really all three have some problems. The most reliable is the command line, but it has the command line problems in that you really are only dealing with one image sequences and you don't really have the images in PHP memory. Sure you can pipe images into and out of the commands to avoid disk temp files. but that is kludgy.

The next most reliable is the MagicWand. The reason the documentation in PHP is not present is because the documentation is for MagickWand in general not for PHP.
If anything has a chance at working well that would be it.

imagick is not under active development from what I saw at that time.

Re: Which should we be using for new PHP development?

Posted: 2007-08-24T16:24:16-07:00
by andrabr
ridera wrote:We need help understanding the merits and future plans for the three Imagemagick PHP programming approaches.

All comments would be greatly appreciated.......
Well, I just wasted two days AND two nights of my life trying to make MagickWand for PHP work with no success (feel free to contact me for details).

Then I installed Imagick from PECL [ pecl install imagick-beta ] and my life is beautiful (yes, it does seem to work with ImageMagick 6.3.5).
The documentation of Imagick in PHP Manual is basic at best, but the functions correspond directly to MagickWand's, so you can use its docs (just remember to contribute your findings to the user notes at PHP Manual).