2006.06.01 03:33 "Re: [Tiff] New Old Jpeg Support", by Joris
Since the new Old Jpeg available in the libtiff 3.8.3. I found it can almost read all the OJPEG-IN-TIFF files that i have encountered.
Thank you... I think. You seem to imply there are some it can't (yet) read. If so, please post them to my private e-mail address, if convinient. I currently don't have much time, but I'll try and investigate them as soon as possible.
Recently I meet another task related with OJPEG-IN-TIFF, I want retrieve all the raw JPEG stream data from the OJPEG-IN-TIFF file without decoding, then output this stream as JFIF file or save it as another well-formated tiff file that can be read by other applications.(this approach saved the time of decompression and compression of the image data)
I recommend this approach. It doesn't just save time by shaving off decompression and subsequent recompress, it also prevents accumulating loss. JPEG, and its OJPEG incarnation in TIFF, are lossy compression schemes, and repetitive recompression with JPEG can cummulate loss badly.
And i have a glimpse on the new tif_ojpeg.c file, and try to doing so. do anyone have any suggestions?
Part of the reason I designed tif_ojpeg the way I did, was this need. It has JPEG (not JFIF!) file generation code already reasonably independent. This does generate a single valid JPEG for the complete image, in the case of continuous non-planar planarconfiguration (99.9% of the tif_ojpeg files). Currently that JPEG is streamed to a LibJpeg decoding session, and the output of that decoding session is streamed to a processing step that re-organizes subsampling, after which it is suitable as TIFF subcodec decoded output. But instead of streaming to LibJpeg, it should be very feasable to make it stream to something else entirely, like file or memory buffer. And it should also not be too hard to add a few markers to make it valid JFIF instead of colorspace ignorant JPEG...
To find out what is what, take a look at the comments near the top of the tif_ojpeg.c file. I've tried to somewhat explain the different parts there.
It was/is my intention to add this particular functionality. But, like I said, I don't have much time right now...
Are there funds available for this project? Do you have an urgent deadline?
Joris Van Damme
Download your free TIFF tag viewer for windows here: