Bug 144601 - Rotating image results in inverted colors
Summary: Rotating image results in inverted colors
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.2.0.4 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.4.0 target:7.3.5
Keywords:
Depends on:
Blocks: Qt5
  Show dependency treegraph
 
Reported: 2021-09-19 11:03 UTC by Jozef Riha
Modified: 2022-05-29 06:48 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
test document (57.72 KB, application/vnd.oasis.opendocument.text)
2021-09-19 11:03 UTC, Jozef Riha
Details
Screenshot depicting the problem (8.30 KB, image/png)
2021-09-19 11:07 UTC, Jozef Riha
Details
short video showing the issue (2.56 MB, video/x-matroska)
2021-09-19 11:40 UTC, Jozef Riha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jozef Riha 2021-09-19 11:03:10 UTC
Created attachment 175115 [details]
test document

To reproduce:
- open attached document in LibreOffice Writer
- rightclick image - rotate by 90 degrees
- observe how the colors of the image change

Arch Linux, x86_64, LibreOffice Community 7.2.1-2
Comment 1 Jozef Riha 2021-09-19 11:07:29 UTC
Created attachment 175116 [details]
Screenshot depicting the problem
Comment 2 Mike Kaganski 2021-09-19 11:14:48 UTC
No repro using Version: 7.2.1.2 (x64) / LibreOffice Community
Build ID: 87b77fad49947c1441b67c559c339af8f3517e22
CPU threads: 12; OS: Windows 10.0 Build 19043; UI render: default; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL

and also no repro using Version: 7.2.1.2 (x64) / LibreOffice Community
Build ID: 87b77fad49947c1441b67c559c339af8f3517e22
CPU threads: 12; OS: Windows 10.0 Build 19043; UI render: Skia/Raster; VCL: win
Locale: ru-RU (ru_RU); UI: en-US
Calc: CL
Comment 3 Julien Nabet 2021-09-19 11:36:42 UTC
Just for the record, on pc Debian x86-64 with master sources updated today, I don't reproduce this gtk3, gen and kf5 rendering.
Comment 4 Jozef Riha 2021-09-19 11:40:18 UTC
Created attachment 175117 [details]
short video showing the issue
Comment 5 Mike Kaganski 2021-09-19 11:44:06 UTC
(In reply to Jozef Riha from comment #4)

The problem is described clearly in comment 0, there is no need to "prove" it. The question is: under which circumstances it happens. And here the important piece is full details from Help->About; also maybe important to describe the details about your system (the version of the OS, and the desktop environment you use; also possibly video HW).
Comment 6 Jozef Riha 2021-09-19 12:39:04 UTC
Help -> About
-------------
Version: 7.2.1.2 / LibreOffice Community
Build ID: 20(Build:2)
CPU threads: 12; OS: Linux 5.14; UI render: default; VCL: qt5 (qfont+xcb)
Locale: en-US (C); UI: en-US
7.2.1-2
Calc: threaded

Distribution information
------------------------
Arch Linux x86_64, rolling
libreoffice-fresh (official distribution package) 7.2.1-2
xorg-server 1.20.13-2, gtk3 1:3.24.30-2, qt5-base 5.15.2+kde+r224-1
Gnome 40.4.0, X11

HW
--
GPU: Nvidia GeForce GTX 980 Ti/PCIe/SSE2 w/ proprietary Nvidia driver (nvidia 470.63.01-11)
Comment 7 Telesto 2021-09-20 07:10:00 UTC
This appears to be a distribution build. Does this also happen with a TDF build?
There different Linux portable builds available. Like an appimage:
https://www.libreoffice.org/download/appimage/
Comment 8 Jozef Riha 2021-09-20 07:17:43 UTC
I can reproduce this with AppImage version 7.2.0.4.
Comment 9 QA Administrators 2021-09-21 04:54:31 UTC Comment hidden (obsolete)
Comment 10 smeetqa 2021-09-29 05:48:25 UTC
No repo using Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: 20f064c1d4d2788edbd4ed7303cf1fcc4f817be4
CPU threads: 4; OS: Linux 5.11; UI render: default; VCL: gtk3
Locale: en-IN (en_IN); UI: en-US
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2021-09-12_10:33:12
Calc: threaded
Comment 11 Buovjaga 2021-09-29 06:39:11 UTC
(In reply to Jozef Riha from comment #6)
> Help -> About
> -------------
> Version: 7.2.1.2 / LibreOffice Community
> Build ID: 20(Build:2)
> CPU threads: 12; OS: Linux 5.14; UI render: default; VCL: qt5 (qfont+xcb)
> Locale: en-US (C); UI: en-US
> 7.2.1-2
> Calc: threaded

I see you are using the qt5 UI backend, which is unusual and not recommended. Do you also see the problem when launching with either of these:

SAL_USE_VCLPLUGIN=gtk3 libreoffice
SAL_USE_VCLPLUGIN=kf5 libreoffice
Comment 12 Jozef Riha 2021-09-29 07:24:39 UTC
> SAL_USE_VCLPLUGIN=gtk3 libreoffice
> SAL_USE_VCLPLUGIN=kf5 libreoffice

The problem disappears with the env. variable set to either of the values above. So it looks like qt5-related issue.
Comment 13 Buovjaga 2021-09-29 07:31:34 UTC
(In reply to Jozef Riha from comment #12)
> > SAL_USE_VCLPLUGIN=gtk3 libreoffice
> > SAL_USE_VCLPLUGIN=kf5 libreoffice
> 
> The problem disappears with the env. variable set to either of the values
> above. So it looks like qt5-related issue.

Great, thanks for testing. Could you try one more final test with qt5:

SAL_VCL_QT5_USE_CAIRO=1 libreoffice

Perhaps telling qt5 to use Cairo will make the problem go away.
Comment 14 Jozef Riha 2021-09-29 08:40:49 UTC
> SAL_VCL_QT5_USE_CAIRO=1 libreoffice

This worked as well. QT5 + Cairo = colors are unchanged.
Comment 15 Buovjaga 2021-09-29 13:01:33 UTC
I repro with

Version: 7.3.0.0.alpha0+ / LibreOffice Community
Build ID: 057a74c2f20256c34e97dae246e6e1867a364b84
CPU threads: 8; OS: Linux 5.14; UI render: default; VCL: qt5 (qfont+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded
Comment 16 Commit Notification 2022-05-28 22:17:35 UTC
Jan-Marek Glogowski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/6959a18d1a8fea4d65498083dc3ba05f640d0f39

tdf#144601 Qt fix creating QImage with alpha mask

It will be available in 7.4.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.
Comment 17 Commit Notification 2022-05-29 06:48:18 UTC
Jan-Marek Glogowski committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/5758469c11fbe199f0136941f9ffc8c29815f562

tdf#144601 Qt fix creating QImage with alpha mask

It will be available in 7.3.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.