Created attachment 200127 [details] bugdoc When LibreOffice is built with --enable-cairo-rgba (--without-system-cairo is implied), then imported images have wrong colors. In fact blue component is counted as green, green component is counted as blue. As you can see in the simple bugdoc: blue and green are swapped when you open it in LibreOffice that was built with --enable-cairo-rgba.
What needs to be noted is that red and blue are expected to be swapped (rgba vs bgra), but the buggy case has another swap, the one noted in the description. rgb (original) -> bgr (expected) -> brg (wrong)
On pc Debian x86-64 with master sources updated today, I could reproduce this. Starting point I suppose: https://opengrok.libreoffice.org/xref/core/include/vcl/cairo.hxx?r=5357da349b4b266b4003d25b61ecb12a515893c4#38
Noel/Caolán: thought you might be interested in this one. I naively tried to swap values of SVP_CAIRO_BLUE and SVP_CAIRO_GREEN in ENABLE_CAIRO_RGBA part of include/vcl/cairo.hxx but no success.
With DISABLE_SYSTEM_DEPENDENT_PRIMITIVE_RENDERER=1 the bug is not there.
I checked with an older build containing the early work from Caolán on this: https://gerrit.libreoffice.org/c/core/+/144632 And with "export TEST_SYSTEM_PRIMITIVE_RENDERER=1" the bug is reproducible already.
Aron Budea committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/69162f01d3449e92e9a8b76c8a09378e1aef8a56 tdf#166005 vcl: cairo: use correct order in RGBA case It will be available in 25.8.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
seems to be the right fix
Created attachment 200156 [details] screenshot Here what I got with --enable-cairo-rgba + master sources updated today (5daab76058e38ae16180b1bea239161b7c8be274) (notice too the color of the icons on the standard toolbar which are wrong).
(In reply to Julien Nabet from comment #8) > Created attachment 200156 [details] > screenshot > > Here what I got with --enable-cairo-rgba + master sources updated today > (5daab76058e38ae16180b1bea239161b7c8be274) > > (notice too the color of the icons on the standard toolbar which are wrong). That's fine, nobody wants --enable-cairo-rgba with desktop LibreOffice. It is for Android and Online. And the fix was verified there.
(In reply to Andras Timar from comment #9) > ... > That's fine, nobody wants --enable-cairo-rgba with desktop LibreOffice. It > is for Android and Online. And the fix was verified there. ok then. Thank you for the very quick feedback! :-)
*** Bug 166965 has been marked as a duplicate of this bug. ***
Aron Budea committed a patch related to this issue. It has been pushed to "libreoffice-25-2": https://git.libreoffice.org/core/commit/f11e05b914dbc69d9f0d1d88445a8f68159b5b46 tdf#166005 vcl: cairo: use correct order in RGBA case It will be available in 25.2.5. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Aron Budea committed a patch related to this issue. It has been pushed to "libreoffice-25-2-4": https://git.libreoffice.org/core/commit/78ef3e95a38af23ba22e0bdc3ed7b7c6f94a1789 tdf#166005 vcl: cairo: use correct order in RGBA case It will be available in 25.2.4. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.