AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

1998.11.23 18:10 "compression == 6", by Charles Auer
1998.11.23 18:14 "Re: compression == 6", by Rex Jolliff

1998.11.23 18:14 "Re: compression == 6", by Rex Jolliff

Is there any source code available for reading old-style JPEG (compression == 6) TIFF images?

If there is a FAQ for this list, I would be suprized if this question isn't the first one on it. The answer you are going to get from people on this list is basically, no. Because the standard is unclear in some areas and violates the spec in others. The claim is that there is as many different interpretations of the JPEG extension as there are vendors who implement it. Also, the TIFF library as it is structured is not designed to read the data from the JPEG tags. Basically the spec says that tags either contain the data they represent if the data is less than or equal to 4 bytes or the tags contain an offset to the data, and that offset always points to a unique area of the TIFF file. I've looked at two different implementations of the JPEG extension, and both write the JFIF header into the file and then have a series of tags that point into it for the DCT and huffman tables. These offsets are not pointing to unique areas of the file. Furthermore, the data does not always fall on a four byte boundry as is specified. One vendor doesn't correctly write the RestartInterval tag, and I had to figure out the value from the RowsPerStrip and ImageWidth tags.

I have my own code which can do some simple manipulation of the Pixel Translations and Wang implementations of the JPEG extensions, but gave up rolling the code into libtiff because of reasons stated above.

Rex.