2012.12.18 20:56 "[Tiff] decoding tiff images with ycbcr and jpeg compression", by swagat mishra

2012.12.19 14:58 "Re: [Tiff] decoding tiff images with ycbcr and jpeg compression", by Bob Friesenhahn

I went through previous posts on the mailing list and it seems this is bug in 4.x.x. Suggested fix   a was to set tiff tag JPEGCOLORMODE to RGB. However that did not work.

Can anyone help me with this?

I see that you have now posted your email three times already. Your email does get through. It is just that no one has responded.

Using GraphicsMagick and libtiff 4.0.3 I am able to load quad-jpeg.tif without any problems. While TIFFReadRGBAImage() may be simple to use, it does not support all TIFF subformats.

For this file, GraphicsMagick uses TIFFReadEncodedStrip(). It does use this hack to cause libjpeg to do the conversion from ycbcr to RGB:

   TIFFSetField( tiff, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB );

After applying this hack, the subsequent code should behave as if the image uses PHOTOMETRIC_RGB rather than PHOTOMETRIC_YCBCR.

Bob
--
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/