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