2003.04.30 14:04 "tiff2ps and /DCTDecode filter", by Tom Kacvinsky

Hi all,

I am trying to get the /DCTDecode filter for JPEG compressed TIFF images to work.

What I have found is that neither the Quantization tables nor the Huffman tables make it into the strip/tile data, so any Adobe DCTDecode filter will choke with a message like:

%%[ Error: ioerror; OffendingCommand: image; ErrorInfo: DCTDecodeFilter JPEG SOFn DQT or DHT marker missing before SOS marker ]%%

But, there is a JPEGTables entry in the TIFF image. My thought on this is to use this data to get the Huffman tables or Quantization tables and then make the appropriate filter dictionary:

    /Colors 3
       /QuantTables [ ... ]
    /HuffTables [ ... ]
  >> /DCTDecode filter

Where can I find documentation on the JPEGTables entry? In the TIFF v6.0 spec?

There are also going to be issues with SamplesPerPixel and he Photometric interpretation. I am still learning about this stuff, so it will be a while before I get my head wrapped around it.

The issues I see with this are (a) I am not sure if the Adode DCTDecode filter will use the information passed in the filter dictionary in lieu of the SOFn JPEG markers and (b) what about different strips/tiles having different quant and/or huff tables?

Thoughts? Tom Lane, if you are still on the libtiff mailing list, I would really appreciate your thoughts on this. I know there are "issues" with using the IJG JPEG library to make JPEG streams that Adobe's interpreters grok...