2001.12.12 20:23 "jpeg in tiff problem", by Eric Hamrick

2001.12.13 02:03 "Re: jpeg in tiff problem", by Frank Warmerdam

I have an imagegear 8 compressed tif containing jpeg data that I cannot read from with the current tiff library compiled with jpeg support. When I read it in, the compression type is listed as 7. But when I call TIFFReadEncodedStrip on the file I receive an error from the JpegPreDecode function saying there is an improper sampling factor. The tif loads correctly in photoshop 6. And my own libtiff created jpeg tifs do not give this error. Does anyone have any ideas why I am getting this error?

Eric,

The file doesn't have a YCbCr sampling value in the TIFF directory, so the library defaults to 2,2. However, the header of the jpeg data stream indicates a 2,1 sampling. Thus the error.

I tried overriding the default sampling value with the value in the jpeg data stream and that seemed to work, so I have modified tif_jpeg.c to always do this if they differ, and to just issue a warning instead of an error.

The updated tif_jpeg.c is in CVS. Let me know if you would like me to email it to you.

Best regards,

---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent