AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2005.05.27 07:46 "[Tiff] how to convert a JPEG-IN-TIFF file to jpeg file without decomress & compress", by Kelvin Zhong
2005.05.28 17:21 "Re: [Tiff] how to convert a JPEG-IN-TIFF file to jpeg file without decomress & compress", by Joris Van Damme
2005.05.30 09:58 "Re: [Tiff] how to convert a JPEG-IN-TIFF file to jpeg file without decomress & co mpress", by Kelvin Zhong
2005.05.30 13:32 "Re: [Tiff] how to convert a JPEG-IN-TIFF file to jpeg file without decomress & compress", by Jean-Yves Le Ridant
2005.05.31 07:24 "Re: [Tiff] how to convert a JPEG-IN-TIFF file to jpeg file without decomress & com press", by Kelvin Zhong
2005.06.29 20:21 "[Tiff] copying jpeg tables", by James Carroll

2005.05.28 17:21 "Re: [Tiff] how to convert a JPEG-IN-TIFF file to jpeg file without decomress & compress", by Joris Van Damme

Kelvin,

Assumption:
 1.JPEG-IN-TIFF was writed as a single strip.

That is indeed a necessary assumption. Every single strip/tile in a JPEG-in-TIFF is a seperate, valid JPEG stream. So the only way it's going to succeed is with single strip(/tile) images.

Even though the JPEG stream is valid, it may not be sufficient, since it may miss some information that is encoded in the JpegTables tag, or in the Photometric tag.

The best scheme, is probably to 'filter'. Scan through the JPEG stream, gather what you need, and together with info in other places like the JpegTables tag, build your output JPEG stream from that, marker by marker. This scheme is recently explained in http://www.asmail.be/msg0054649067.html, even if that was in the context of the inverse direction (JPEG to JPEG-in-TIFF).

and i found it seemed to loss some infomations(something like
FILE header ?....,such like BITMAPFILEHEADER to BMP files...)

On what did you base that conclusion? JPEG doesn't have a very elaborate 'file header'. It's a stream of markers. Each marker starts with a 255 byte, followed by a marker identifier byte. The very first marker in there should be the SOI marker, which means the stream should start with a 255 byte, followed by a 216 byte, from the top of my head.

Joris Van Damme
info@awaresystems.be
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html