mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 00:36:51 +00:00
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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4756>
This commit is contained in:
parent
e4c43db5d5
commit
476d350b03
1 changed files with 1 additions and 1 deletions
|
@ -250,7 +250,7 @@ gst_pngdec_caps_create_and_set (GstPngDec * pngdec)
|
||||||
|
|
||||||
/* Add alpha channel if 16-bit depth, but not for GRAY images */
|
/* Add alpha channel if 16-bit depth, but not for GRAY images */
|
||||||
if ((bpc > 8) && (color_type != PNG_COLOR_TYPE_GRAY)) {
|
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);
|
png_set_swap (pngdec->png);
|
||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
|
|
Loading…
Reference in a new issue