From f44a18ee97838b42d65a80f2d4145ed8cc719f0f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Piotr=20Brzezi=C5=84ski?= Date: Thu, 1 Jun 2023 16:21:47 +0200 Subject: [PATCH] pngdec: Fix 16bit RGB images display Due to the alpha value being inserted with _BEFORE, we were ending up with ARGB instead of RGBA, thus displaying completely wrong colours. According to libpng's manual, "to add an opaque alpha channel, use filler=0xff or 0xffff and PNG_FILLER_AFTER which will generate RGBA pixels". Part-of: --- subprojects/gst-plugins-good/ext/libpng/gstpngdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-good/ext/libpng/gstpngdec.c b/subprojects/gst-plugins-good/ext/libpng/gstpngdec.c index 3775227..dc2043f 100644 --- a/subprojects/gst-plugins-good/ext/libpng/gstpngdec.c +++ b/subprojects/gst-plugins-good/ext/libpng/gstpngdec.c @@ -250,7 +250,7 @@ gst_pngdec_caps_create_and_set (GstPngDec * pngdec) /* Add alpha channel if 16-bit depth, but not for GRAY images */ if ((bpc > 8) && (color_type != PNG_COLOR_TYPE_GRAY)) { - png_set_add_alpha (pngdec->png, 0xffff, PNG_FILLER_BEFORE); + png_set_add_alpha (pngdec->png, 0xffff, PNG_FILLER_AFTER); png_set_swap (pngdec->png); } #if 0 -- 2.7.4