2005.10.14 10:46 "[Tiff] TIFFUnlinkDirectory bug with directory number", by Шебеко Евгений

2005.10.14 10:46 "[Tiff] TIFFUnlinkDirectory bug with directory number", by Шебеко Евгений

I think it's bug.

If TIFFSetDirectory() numerate directories from 0, then TIFFUnlinkDirectory() should numerate from 0. But actually numerating in this function begin with 1.

This code for example remove nothing.

int main(int argc,char** argv)
{

    TIFF* tif=TIFFOpen("empty.tif","a");
        TIFFUnlinkDirectory(tif,0);
        TIFFClose(tif);
        return 0;
}

But if we replace to
        TIFFUnlinkDirectory(tif,1);
this remove first directory.

Source file contain 8 images. This is true for first,middle and last directory.

I tested it with libtiff-3.7.4 release