2000.09.07 12:31 "Re: OJPEG code", by Joris Van Damme
At least of of the current test files for libtiff is YCbCr with OJPEG compression. How do I turn on OJPEG support? Where is the code to integrate and instructions?
There have been several discussions about this in the past.
You don't have to believe me, but I am convinced it is not feasable. For starters, there is simply no such thing as an OJPEG compression. Instead, there are numerous interpretations of OJPEG. If you succeed in reading OJPEG tiffs from one library, chances are almost zero the same code will succeed in reading OJPEG tiffs from another library. And that's not the only problem... Technote #2 exists for some very good reasons and not supporting the original JPEG compression in the TIFF 6.0 specifications is not a shortcomming but a justified descision.
ycbcr-cat.tif doesn't even read with the toolkit. Is anyone sure that YCbCr even works in Libtiff?
I don't know about the toolkit (I suppose you mean the numerous little applications that come with the library), but the core libtiff does handle YCbCr. I can read ycbcr-cat.tif without problems. The trick to use libtiff on the widest range of images possible, is to deduct what I call a 'reading strategy' from the tag information. You'll find that Ycbcr images need strategies different from all others if they are subsampled, because the library can only return the subsampled image color data. In the case of ycbcr-cat, my code uses a strategy called 'YcbcrCnn', which means Ycbcr, continuous, non-tiled, no alpha. This strategy reads the image with calls to read_encoded_strip, and desubsamples the returned data.
Euh, yeah, I do admit that this way to do it results in a lot of different 'reading strategies' (16), and subsequently a lot of code to write. But that is the game of the tiff beast, I suppose.