2005.03.22 17:20 "[Tiff] tif_jpeg.c and 12bit JPEG Files", by Frank Warmerdam

2005.03.22 18:04 "Re: [Tiff] tif_jpeg.c and 12bit JPEG Files", by Bob Friesenhahn

My general intent then is to modify the tif_jpeg.c JPEGDecode() (and likely JPEGEncode()) to support repacking 12bit data from 16 bit JSAMPLEs returned by libjpeg into packed 12bit format in the TIFF buffer. This seems to be the main barrier to correct operation currently. But there are a few other patches needed, and also the ability to autodetect at build time which style of libjpeg is being used. The traditional "6b" libjpeg, or the newer "Mk1".

This sounds good to me. As I mentioned in a prior email, libtiff needs to provide an interface (probably styled like a tag) which supports testing for the supported JPEG bit depths. Without this, applications which could support 8 bits, 12 bits, or both in the same build, will not know what libtiff supports and may request a depth which causes gruesome errors later on.

BTW, the 6b libjpeg has to be built either in 8bit mode or 12bit mode. One build of the library cannot support both forms. The new Mk1 library always returns samples as 16 samples and can read either 8bit or 12bit files dynamically.

Libtiff should also support 12 bits using 6b libjpeg if possible. I believe that the interface is compatible since it looks like the "Mk1" interface.

Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/