2005.04.29 22:52 "[Tiff] Color TIFF/JPEG compression questions", by Jason Frank

2005.05.02 18:17 "RE: [Tiff] Color TIFF/JPEG compression questions", by Jason Frank

Thanks for the schooling. That shiny new JPEG compression scheme is really quite clever. I've taken a look at the code for tif_print.c, and it looks correct. It goes like this:

        if (TIFFFieldSet(tif,FIELD_YCBCRSUBSAMPLING))
        {
            /*
             * For hacky reasons (see tif_jpeg.c - JPEGFixupTestSubsampling),
             * we need to fetch this rather than trust what is in our
             * structures.
             */
            uint16 subsampling[2];

            TIFFGetField( tif, TIFFTAG_YCBCRSUBSAMPLING,
                          subsampling + 0, subsampling + 1 );
                fprintf(fd, "  YCbCr Subsampling: %u, %u\n",
                        subsampling[0], subsampling[1] );
        }

I didn't find any redefinitions of TIFFTAG_YCBCRSUBSAMPLING, and I didn't see any suspicious TiffSetFields in tiffinfo.c either. I did notice that tiffdump said:

YCbCrSubsampling (530) SHORT (3) 2<2 2>

On the very last line.

So, I think that tiffinfo might be playing correctly here (since it agrees with tiffdump, and I don't see any obvious problems with the code.)

Jason