AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
May 2017

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



2017.05.02 15:55 "Possible patch/update to allow for a black/white image that has SAMPLEFORMAT tag set", by Michael Shiels

We have run into a number of these and found changing this code in
tif_dirread.c but in the older 3.5.6/3.5.7 era code.  I don't seem to have
saved a copy of one of those images for comparison/testing purposes.  But
basically the setfield would fail on _SAMPLEFORMAT for a 1bpp image.   So we
attempt to copy the tag data but do not consider it an error - possibly not
best solution, but we needed something quick in our case.

 

                              case TIFFTAG_DATATYPE:

                              case TIFFTAG_SAMPLEFORMAT:

                                             if
(!TIFFFetchPerSampleShorts(tif, dp, &iv) ||

                                                 !TIFFSetField(tif,
dp->tdir_tag, iv))

                                                            goto bad;

                                             break;

 

 

To this

 

                              case TIFFTAG_DATATYPE:

                                             if
(!TIFFFetchPerSampleShorts(tif, dp, &iv) ||

                                                 !TIFFSetField(tif,
dp->tdir_tag, iv))

                                                            goto bad;

                                             break;

                              case TIFFTAG_SAMPLEFORMAT:

                                             if
(TIFFFetchPerSampleShorts(tif, dp, &iv))

                                                 TIFFSetField(tif,
dp->tdir_tag, iv);

                                             break;

 

 

Would resolve the issue