don't invert signed ints in tiffload

This commit is contained in:
John Cupitt 2019-08-07 17:08:18 +01:00
parent 7250b169d4
commit 7abe129ac4
2 changed files with 6 additions and 1 deletions

View File

@ -938,7 +938,12 @@ rtiff_greyscale_line( Rtiff *rtiff,
int photometric_interpretation =
rtiff->header.photometric_interpretation;
VipsBandFormat format = rtiff_guess_format( rtiff );
gboolean invert = photometric_interpretation == PHOTOMETRIC_MINISWHITE;
/* Swapping black and white doesn't work for the signed formats.
*/
gboolean invert =
photometric_interpretation == PHOTOMETRIC_MINISWHITE &&
vips_band_format_isuint( format );
int x, i;