Page 1 of 1

Convert in PHP on osx

Posted: 2014-06-17T15:02:51-07:00
by Noir
Hello,

i have an problem with ImageMgaick convert.

Operation System is os x 10.9, i had install ImageMagick with brew and libtiff support.
On this mac runs an xampp server. I want to run this Command from php:

Code: Select all

system('convert -define compose:outside-overlay -limit thread 1 "/path/to/picture/_render/source/end_0070.tif"  -background none -layers merge "/path/to/picture/_render/target/end_0070.tif"', $returnValue);
But i get following error on xampp, but when i run this command on bash all works fine.

Code: Select all

convert: unable to load module `/usr/local/Cellar/imagemagick/6.8.9-1/lib/ImageMagick//modules-Q16/coders/tiff.la': file not found @ error/module.c/OpenModule/1282. convert: no decode delegate for this image format `TIFF' @ error/constitute.c/ReadImage/501. convert: no images defined `/path/to/picture/_render/target/end_0070.tif' @ error/convert.c/ConvertImageCommand/3187.
Return: convert: no images defined `/path/to/picture/_render/target/end_0070.tif' @ error/convert.c/ConvertImageCommand/3187.

Re: Convert in PHP on osx

Posted: 2014-06-17T15:32:16-07:00
by fmw42
Does convert -version list libtiff for one of its delegates. If not, then it was not installed correctly or you did not install IM after installing libtiff

Re: Convert in PHP on osx

Posted: 2014-06-18T00:40:36-07:00
by Noir
From convert -version i get this list:

Code: Select all

Features: DPC Modules
Delegates: bzlib freetype jng jpeg ltdl lzma png tiff xml zlib
I had first install libtiff and then IM.

This error is only in PHP, when i run this Command on a Terminal all works fine.

Re: Convert in PHP on osx

Posted: 2014-06-18T09:34:41-07:00
by fmw42
The only thing that I can suggest at this time is to try adding the full path to convert in your PHP exec command.

Try something simple

convert image.png image.tiff

then

convert image.tiff image.png

Do those work? Is it possible your tiff file is corrupt?

Re: Convert in PHP on osx

Posted: 2014-06-18T10:27:11-07:00
by Noir
When i add the full path in my PHP command i get the same error.

Convert from image.png to image.tiff and from image.tiff to image.png works.

It is possible that my tiff file is corrupted.
When i run the command in bash with original tiff file, i get no errors and convert work.

Re: Convert in PHP on osx

Posted: 2014-06-18T13:30:35-07:00
by fmw42
Is PHP linked to an older version of IM and perhaps without libtiff or an older version of libtiff?

Re: Convert in PHP on osx

Posted: 2014-06-18T16:02:56-07:00
by Noir
I have solved this problem.

XAMPP use an old version of libtiff.5.dylib

Now i use the new version and all works.

Thank you very much, for your help.