From 89284bfac9fc0bf070194861427d2067a53c2d09 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 4 Dec 2024 12:57:30 +0000 Subject: [PATCH 1/2] fix alpha shift during colourspace conversion The colour functions were not shifting alpha channels, just casting them, so operations which changed depth, like `icc_transform --depth 8` on a 16-bit image, could have an incorrectly scaled alpha. See https://github.com/libvips/libvips/issues/4301 Thanks frederikrosenberg --- ChangeLog | 1 + libvips/colour/colour.c | 1 + 2 files changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index c9e81033b2..efb5e904a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ - fix SZI write with openslide4 [goran-hc] - heifsave: prevent use of AV1 intra block copy feature [lovell] - threadpool: improve cooperative downsizing [kleisauke] +- fix alpha shift during colourspace conversions 10/10/24 8.16.0 diff --git a/libvips/colour/colour.c b/libvips/colour/colour.c index c42dcba8ef..b9e0fa92c0 100644 --- a/libvips/colour/colour.c +++ b/libvips/colour/colour.c @@ -371,6 +371,7 @@ vips_colour_build(VipsObject *object) */ if (vips_cast(extra_bands[i], &t1, out->BandFmt, + "shift", TRUE, NULL)) { g_object_unref(out); return -1; From 9eda7dcd738271084ee2f6836ee998799950c04d Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 4 Dec 2024 13:00:38 +0000 Subject: [PATCH 2/2] credit in changelog --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index efb5e904a4..e13b37c190 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,7 +9,7 @@ - fix SZI write with openslide4 [goran-hc] - heifsave: prevent use of AV1 intra block copy feature [lovell] - threadpool: improve cooperative downsizing [kleisauke] -- fix alpha shift during colourspace conversions +- fix alpha shift during colourspace conversions [frederikrosenberg] 10/10/24 8.16.0