2007.02.05 18:49 "Re: [Tiff] Request help On OJPEG Compression In Libtiff", by Joris Van Damme
Compression? The version of libtiff i grab it from CVS and it's said no required hack on libjpeg, and i try just to use it by calling TIFFSetField(tiffout, TIFFTAG_COMPRESSION, COMPRESSION_OJPEG), and this seem not correct.
I misunderstood you before, or either you misunderstand TIFF decompression using LibTiff.
There is support for decompressing most flavours of bad old OJPEG. There is no support for compressing with this scheme. There's plenty of good reason for that decision, mostly being that the original OJPEG spec is totally flawed and breaks TIFF, and furthermore is ambigious, which lead to many different mutually incompatible implementations by vendors. These days, OJPEG is only written by either a) vendors who have an interest in locking their users even when the latter try and use an open file format, and b) vendors who have a need to be compatible with the a).
If you need JPEG compression in TIFF, you need to look into new-style JPEG compression.
If you need OJPEG decompression, you don't need to set the TIFFTAG_COMPRESSION field. Rather, consult the LibTiff docs, namely preferably the part on how to use the RGBAImage interface, as that'll take care of desubsampling issues for you.
Joris Van Damme
Download your free TIFF tag viewer for windows here: