Bug 99795 - OpenGL scaling of .png file uglier than it could be
Summary: OpenGL scaling of .png file uglier than it could be
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
5.0.2.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
QA Contact:
URL:
Whiteboard: target:5.3.0 target:5.2.0.1 target:5.1.4
Keywords:
Depends on:
Blocks: VCL-OpenGL
  Show dependency treegraph
 
Reported: 2016-05-12 12:03 UTC by Marcel Reijnen
Modified: 2016-10-25 18:54 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenprint of empty file with logo in LO 5.1.2.2 (28.41 KB, image/jpeg)
2016-05-12 12:03 UTC, Marcel Reijnen
Details
This is the writer file with logo (8.51 KB, image/png)
2016-05-12 12:46 UTC, Marcel Reijnen
Details
Empty document with the logo (64.31 KB, application/vnd.oasis.opendocument.text)
2016-05-12 12:49 UTC, Marcel Reijnen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel Reijnen 2016-05-12 12:03:16 UTC
Created attachment 124999 [details]
Screenprint of empty file with logo in LO 5.1.2.2

I updated from 5.0.6 to 5.1.2.2 today and my logo in a .png file is barely readable. The .png file is rendered badly. This was fine with all former versions of libreoffice. The problem ocurs in writer, calc and impress.
Comment 1 raal 2016-05-12 12:36:45 UTC Comment hidden (obsolete)
Comment 2 Marcel Reijnen 2016-05-12 12:46:51 UTC
Created attachment 125003 [details]
This is the writer file with logo

This file is a screenprint from version 5.0.6. The logo is well rendered on the screen here.
Comment 3 Marcel Reijnen 2016-05-12 12:49:02 UTC
Created attachment 125004 [details]
Empty document with the logo

This file is the document i made two screenprints from. One with version 5.0.6 and one with version 5.1.2.2
Comment 4 Aron Budea 2016-05-12 15:24:07 UTC
Marcel, can you check your About window, what does it say for "UI Render:", "GL" or "default"?

I checked, and can confirm with OpenGL enabled in Windows 7, LO 5.1.2, 5.1.3, and master builds (039b75d6cdc26dcce03e37c67115405e6f2a8ebe).
Does not occur with default rendering.
Comment 5 Marcel Reijnen 2016-05-12 17:25:53 UTC
I can confirm that my about window says: UI Render: GL.
So this should be the problem?
Comment 6 raal 2016-05-12 18:45:07 UTC
confirmed in comment 4. Thanks Aron.
Comment 7 Aron Budea 2016-05-12 20:43:44 UTC
(In reply to Marcel Reijnen from comment #5)
> I can confirm that my about window says: UI Render: GL.
> So this should be the problem?

Yes, it seems to be a bug in the OpenGL renderer. As a workaround you can disable it by unticking this: OpenGL in Tools -> Options -> LibreOffice -> View -> Use OpenGL for all rendering (on restart)
(if it's already unticked, try ticking and unticking it)

I could also reproduce the bug in Linux with LO 5.0.2.2 and 5.1.3.2 (OpenGL enabled).
As long as there's no working example using OpenGL rendering in a prior release, this is not a regression, so I'm removing the keyword.

The issue is tied to zoom levels, zoomed-out image shows similar distortion as watching a high pixel image in low resolution, but looks worse than default rendering.
Comment 8 Marcel Reijnen 2016-05-13 09:38:59 UTC
Solved with the workaound.
Comment 9 Tor Lillqvist 2016-05-24 13:15:24 UTC
I guess the logo is just pathological in the sense that the thin details, when scaled down as much as happens in this document, on typical displays, they end up being less than a pixel in size, and how they end up being displayed is fairly arbitrary. It is just a coincidence that without OpenGL, the scaling works so that the thin details still are visible. (If the logo would be scaled still smaller, the details would disappear also in the non-OpenGL case.) But sure, clearly how this works out in the OpenGL case is a disappointment to the user.
Comment 10 Commit Notification 2016-06-09 10:15:20 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=19baa61e1d7b140b9e24717f7080617ab3d324d4

tdf#99795 drawAlphaBitmap should scale the bitmap if necessary

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2016-06-09 13:17:03 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=511ebf799457d41429554d26ec30934435146ece&h=libreoffice-5-2

tdf#99795 drawAlphaBitmap should scale the bitmap if necessary

It will be available in 5.2.0.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2016-06-11 10:16:34 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "libreoffice-5-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=86fef4ea205f3001305a6122bfa127b196e2d345&h=libreoffice-5-1

tdf#99795 drawAlphaBitmap should scale the bitmap if necessary

It will be available in 5.1.5.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 13 Commit Notification 2016-06-14 14:52:06 UTC
Tomaž Vajngerl committed a patch related to this issue.
It has been pushed to "libreoffice-5-1-4":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=4d2fd2b07726af1c2652c3ece7b1f468b5f5d35b&h=libreoffice-5-1-4

tdf#99795 drawAlphaBitmap should scale the bitmap if necessary

It will be available in 5.1.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.