2005.01.28 16:03 "[Tiff] planarconfig", by Antoine

2005.01.29 11:50 "Re: [Tiff] planarconfig", by Antoine

Is there something I am missing about how tiff works?

It sounds like the reading program is not properly supplying the default value.

Hi I probably should have stipulated that I was using a modified tiffcp to do this. So it is basically TIFFGetField and TIFFSetField. Basically I got rid

It sounds like you just need to use TIFFGetFieldDefaulted rather than TIFFGetField.

ps. I still don't understand why, but opentiff won't copy an image over if planarconfig is not set but will happily remove it afterwards.

Sounds like a bug.

libtiff won't copy an image over without it either... not without a hack. I would truly love to know why libtiff decided to force the presence of a tag that the spec *specifically* states is optional. There is certainly a logic - anyone care to enlighten me?

The offending lines are indeed "in there somewhere" - lines 519-524 of tif_write.c:

if (!TIFFFieldSet(tif, FIELD_PLANARCONFIG)) {
        TIFFError(module,
     "%s: Must set \"PlanarConfiguration\" before writing data",
            tif->tif_name);
        return (0);
}

Commenting it out, at least for the files I have tested so far, has the desired effect.

Cheers
Antoine