2008.02.13 22:45 "[Tiff] 12 bit jpeg", by Joel Wilson

2008.02.13 23:50 "Re: [Tiff] 12 bit jpeg", by Frank Warmerdam

I am trying to implement 12 bit jpeg and have run into some issues. I am using the mk1-branch version of libjpeg. I made some minor changes to tif_jpeg.c and jcofig.h to get it to build with visual studio 9. When I try to compress a 12 bit image I receive this error.

            JPEGLib: Missing Huffman code table entry

I found a post that suggested to change line 1345 of tif_jpeg.c from

if (sp->jpegtablesmode & JPEGTABLESMODE_HUFF )


            if( (sp->jpegtablesmode & JPEGTABLESMODE_HUFF &&
sp->tif->tif_dir.td_bitspersample == 8 ))

This did allow the compression to run, but the resulting image shows up as all green with some detail in the background. I am trying to match Intergraph’s 12 bit jpeg compressed imagery. It appears that the problem is that my jpeg table is a third the size of when I run it with the Intergraph software. Does anyone have any suggestions?


I'm not absolutely positive the 12bit writing support ever really worked properly. Definately, at the time, the 12bit reading was the focus and I think still works when built properly.

Best regards,

I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam

and watch the world go round - Rush    | President OSGeo, http://osgeo.org