plug-ins: fix not converting 8 bps grayscale MINISWHITE TIFF

We only set tiff_mode for images with bps < 8, but we also use it for
8 bps grayscale images to detect if MINISWHITE needs to be converted.

So, let's always set tiff_mode for PALETTE, MINISBLACK and MINISWHITE.
This commit is contained in:
Jacob Boerema 2022-06-08 14:34:03 -04:00
parent 94de89febf
commit 2e4b9bcba7
1 changed files with 9 additions and 7 deletions

View File

@ -821,15 +821,17 @@ load_image (GFile *file,
case PHOTOMETRIC_PALETTE:
case PHOTOMETRIC_MINISBLACK:
case PHOTOMETRIC_MINISWHITE:
/* Even for bps >= we may need to use tiff_mode, so always set it.
* Currently we use it to detect the need to convert 8 bps miniswhite. */
if (photomet == PHOTOMETRIC_PALETTE)
tiff_mode = GIMP_TIFF_INDEXED;
else if (photomet == PHOTOMETRIC_MINISBLACK)
tiff_mode = GIMP_TIFF_GRAY;
else if (photomet == PHOTOMETRIC_MINISWHITE)
tiff_mode = GIMP_TIFF_GRAY_MINISWHITE;
if (bps < 8)
{
if (photomet == PHOTOMETRIC_PALETTE)
tiff_mode = GIMP_TIFF_INDEXED;
else if (photomet == PHOTOMETRIC_MINISBLACK)
tiff_mode = GIMP_TIFF_GRAY;
else if (photomet == PHOTOMETRIC_MINISWHITE)
tiff_mode = GIMP_TIFF_GRAY_MINISWHITE;
/* FIXME: It should be a user choice whether this should be
* interpreted as indexed or grayscale. For now we will
* use indexed (see issue #6766). */