tdf#74331: 16bit "min-is-black" tiff not loaded correctly
commitbd1d0967920655ef85a2352259332f99fef6876e
authorJulien Nabet <serval2412@yahoo.fr>
Thu, 21 Apr 2022 09:54:49 +0000 (21 11:54 +0200)
committerJulien Nabet <serval2412@yahoo.fr>
Thu, 28 Apr 2022 10:40:21 +0000 (28 12:40 +0200)
treef861c6e102276311687f0b4e70619aa170e757b5
parent12dcfc191bc258b51f5d00f46ea44a6a1c6fda91
tdf#74331: 16bit "min-is-black" tiff not loaded correctly

Since 16 bits part is well taken into account for photometric interpretation "RGB",
just consider greyscale as subcase of rgb since greys are just "RGB" colors with same value for red, green and blue
Finally, in ConvertScanline, nPhotometricInterpretation <= 1 (so "min is white" and "min is black") with nSamplesPerPixel = 1
corresponds to nDstBitsPerPixel = 8 here, so consider this specific case in the same block.

The last piece to adjust is when calling SetPixel:
nPhotometricInterpretation = 1 corresponds to the same case as nPhotometricInterpretation = 2
since RGB black is 0, nPhotometricInterpretation = 1 is minisblack so here too black is 0

Change-Id: I5c8e420f851ed6e31998c0698d86300aaa7c4b19
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133251
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
vcl/source/filter/itiff/itiff.cxx