From: Piotr BrzeziƄski Date: Thu, 1 Jun 2023 14:21:47 +0000 (+0200) Subject: pngdec: Fix 16bit RGB images display X-Git-Tag: 1.22.7~242 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f44a18ee97838b42d65a80f2d4145ed8cc719f0f;p=platform%2Fupstream%2Fgstreamer.git 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: --- 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