Issue #85: Troubles opening 16-bit floating point grayscale files.
authorJehan <jehan@girinstud.io>
Tue, 14 Feb 2023 09:50:20 +0000 (10:50 +0100)
committerJehan <jehan@girinstud.io>
Tue, 14 Feb 2023 10:04:17 +0000 (11:04 +0100)
commit722b7851b1df793152f2280cd17b2672d3b731b6
treea0548e0ac9ced11fcf5128708ad3e8ec155ed53d
parentda380ab0a8a60157ad069bba6aebca58ba18f087
Issue #85: Troubles opening 16-bit floating point grayscale files.

All current LUT conversion and creation clearly assume that we are
operating on 1 byte per channel (the flag we use right now to determine
if we may have a LUT is even called `is_u8_color_conv`). So let's
enforce this.

Otherwise we might end up with problems such as in issue #85, where we
convert from or to "YA u16", which is still under 4bpp but not 1bpc. As
a consequence, the first byte of the alpha only was copied and the rest
(including the second alpha byte) was used as belonging to the color
components.

Of course, we can update this code later to also support such cases
(taking into account the source and target alpha size), but for now,
let's simply exclude these.
babl/babl-fish-path.c