2010.04.26 18:39 "[Tiff] Bug in tif_print.c for TIFFTAG_REFERENCEBLACKWHITE", by Edward Lam

2010.04.26 20:59 "Re: [Tiff] Bug in tif_print.c for TIFFTAG_REFERENCEBLACKWHITE", by Olivier Paquet

On Mon, Apr 26, 2010 at 4:12 PM, Edward Lam <edward@sidefx.com> wrote:

Edward Lam wrote:
I have an 6-Bit RGBA image and using tiffinfo on it gives:  >

Er, I meant 8-bit here of course.

I also noticed another problem with the number of expected floats for TIFFTAG_REFERENCEBLACKWHITE in the documentation for TIFFSetField:

     http://libtiff.maptools.org/man/TIFFSetField.3tiff.html       
where it says:

>      2*SamplesPerPixel

That's also what the TIFF spec says in appendix A. Of course, other mentions of the tag specify 6 float. The spec also says:

    The ordering of pairs is the same as those for pixel components of
    the PhotometricInterpretation type. ReferenceBlackWhite can be applied
    to images with a PhotometricInterpretation value of RGB or YCbCr.
    ReferenceBlackWhite is not used with other PhotometricInterpretation values.

Which implies the tag will only ever have 6 values as both RGB and YCbCr have 3 components. libtiff always reads/writes 6 floats so it is definitely wrong to try to display 8 values.

Are there any objections to hardcoding the output of 6 values?

Olivier