AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
March 2008

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2008.03.12 07:07 "encapsulate jpeg to TIFF without de-compressing and re-compressing", by Zhang Weiwu
2008.03.17 18:13 "Re: encapsulate jpeg to TIFF without de-compressing andre-compressing", by Gerben Vos
2008.03.18 01:29 "Re: encapsulate jpeg to TIFF without de-compressing andre-compressing", by Zhang Weiwu
2008.03.18 10:55 "Re: encapsulate jpeg to TIFF without de-compressing andre-compressing", by Gerben Vos

2008.03.17 18:13 "Re: encapsulate jpeg to TIFF without de-compressing andre-compressing", by Gerben Vos

Zhang Weiwu wrote:

> Hi. I had been looking for an way to// //encapsulate an existing jpeg
> file to TIFF format, without de-compress it first and re-compress it
> again.

Yes, you can do this. Basically, you just set the ImageWidth and
ImageHeight tags to the size of the JPEG, and write the JPEG data in
a single strip with TIFFWriteRawstrip(). Also set the other necessary TIFF tags, of course.

If you don't know the image size, you must scan the JPEG for the marker
that indicates it. (I don't know which they are, sorry. We have some
code - proprietary, sorry - that converts PDF to TIFF in a similar way,
and we can take the size information from the PDF...)

Also, you may want to scan the JPEG for the "APPE" marker (0xFF 0xEE) to
find out if a colour transformation from RGB or YUV has taken place, and
to set the Photometric tag accordingly. Similarly for the SOF0 marker
(0xFF 0xC0) which contains the subsampling values (see TIFF Technote 2)
and the YCbCrSubsampling tag.

A draft copy of the JPEG spec (but very usable) can be found at
http://www.jpeg.org/public/fcd14492.pdf .

					Gerben Vos.

-- 
Please respond to the mailing list, not to me directly.