mirror of
https://github.com/storytold/photocraft.git
synced 2026-10-28 10:11:58 +01:00
TIFF 6.0 allows the alpha at any ExtraSamples position, but the decoder only looked at the first extra sample, and for RGB/CMYK the tiff crate drops every sample after its colour type. With ExtraSamples [0, 2] the alpha was silently lost (and gray [0, 2] opened as plain gray). The alpha is now the first extra sample marked associated (1) or unassociated (2), wherever it is. When it is not the first extra sample of an RGB or CMYK image, the crate is asked for every sample (the photometric is patched to multiband gray, as for WhiteIsZero) and the colour and alpha samples are picked per chunk; planar files read the alpha's own plane. Associated alpha in that position is made straight. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>