I've recently dealing with tiff images using php and imagick. I found a weird tiff image.
Because the RHEL5 Distribution's ImageMagick's somehow outdated for PHP Imagick, so I compiled a IM myself, using 6.7.3-1.
But when I was trying load a tiff file, it complained about
Code: Select all
/tmp/a.tif: Can not read TIFF directory count. `TIFFReadCustomDirectory' @ error/tiff.c/TIFFErrors/505
compression not supported `/tmp/a.tif' @ error/tiff.c/ReadTIFFImage/1035
the compiled IM of mine is built with system's libtiff and libjpeg, so I think this shouldn't me cause any problem?JPEG to TIFF conversion...
convert image.jpg image.tif
This will either save the image inside the TIFF file using JPEG compression
(whcih was inherited from the JPEG input. Or it will error such as...
Error: "JPEG compression support not configured"
This is caused by the TIFF library not including JPEG compression support.
Either way THIS IS BAD.
You can get around this problem by changing the setting to use a different
compression algorithm:
convert image.jpg -compress zip image.tif
convert image.jpg -compress lzw image.tif
convert image.jpg +compress image.tif
WARNING: -compress Group4 with a TIFF works, but ONLY if you remove all
transparent and semi-transparent pixels from the image. Typically you can
make sure this is done the same way as JPEG images above, using
-background {color} -flatten
or -bordercolor {color} -border 0
just before the final save (the first only works for single images).
I would really like to use rather new version of IM (at least 6.6+), so I'm left no choice but compile it by my self. But I have no luck to get rid of this problem.
The file can be found here, http://dl.dropbox.com/u/5976062/sample.tif
Could anyone figure out it for me ?
Thanks!