Bug 130128 - GTK3: Border around logo in about dialog
Summary: GTK3: Border around logo in about dialog
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.0.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.5.0
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2020-01-22 16:53 UTC by Xisco Faulí
Modified: 2020-01-28 09:06 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
6.5 vs 6.4 (149.31 KB, image/png)
2020-01-22 16:53 UTC, Xisco Faulí
Details
transparent bg (17.37 KB, image/png)
2020-01-24 15:37 UTC, Caolán McNamara
Details
white bg after change (13.88 KB, image/png)
2020-01-24 15:38 UTC, Caolán McNamara
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2020-01-22 16:53:25 UTC
Created attachment 157333 [details]
6.5 vs 6.4

Steps to reproduce:
1. Open LibreOffice
2. Help - about LibreOfice

Reproduced in

Version: 6.5.0.0.alpha0+
Build ID: a821d89646ef25428cf5992f86d8f31581313bdb
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded
Comment 1 Xisco Faulí 2020-01-22 16:54:41 UTC
Regression introduced by:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=86d44930eecb5e8933f6870684adbb5f9200d6f7


author	Luboš Luňák <l.lunak@collabora.com>	2019-12-20 19:40:00 +0100
committer	Luboš Luňák <l.lunak@collabora.com>	2020-01-21 11:25:19 +0100
commit 86d44930eecb5e8933f6870684adbb5f9200d6f7 (patch)
tree 617a89cd8aea0019d13883a5e2970c33ce86aaec
parent e7b8ed940ecc5397212ae25f48e58618fa8ac6fd (diff)
avoid needless 32bpp->24+8bpp conversion in png writer

Bisected with: bibisect-linux64-6.5

Adding Cc: to Luboš Luňák
Comment 2 Luboš Luňák 2020-01-24 09:51:27 UTC
I cannot reproduce. I've built 6b4fe3e44b4daa89fef6a3385919b00472eaed60 and if I run 'SAL_USE_VCLPLUGIN=gtk3 soffice', I get always the same result with or without the patch reverted. And the patch is about writing .png files, so I don't see how it should affect anything loaded by LO. Are you sure it's really my commit?
Comment 3 Caolán McNamara 2020-01-24 15:29:29 UTC
In vcl/unx/gtk3/gtk3gtkinst.cxx the logo of the About Box is set via set_logo and the input css::graphic::XGraphic is serialized to a png with...

getPixbuf(const css::uno::Reference<css::graphic::XGraphic>& rImage)
Image aImage(rImage);
vcl::PNGWriter aWriter(aImage.GetBitmapEx()...
to a GdkPixbuf

so we can feed it to gtk_about_dialog_set_logo

I can confirm it appears to begin happening at the mentioned commit
Comment 4 Caolán McNamara 2020-01-24 15:37:12 UTC
a debugging patch of...

diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index c4b58aaebc67..0b963d43bd10 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -3112,6 +3112,9 @@ namespace
         vcl::PNGWriter aWriter(aImage.GetBitmapEx(), &aFilterData);
         aWriter.Write(*xMemStm);
 
+        SvFileStream aStream("/tmp/dumpme.png", StreamMode::STD_READWRITE | StreamMode::TRUNC);
+        aWriter.Write(aStream);
+
         return load_icon_from_stream(*xMemStm, "png");
     }
 
gives... a png with a white bg after the change and a transparent one before the change
Comment 5 Caolán McNamara 2020-01-24 15:37:47 UTC
Created attachment 157404 [details]
transparent bg
Comment 6 Caolán McNamara 2020-01-24 15:38:19 UTC
Created attachment 157405 [details]
white bg after change
Comment 7 Luboš Luňák 2020-01-26 20:46:29 UTC
The alpha handling in LO is such a mess :(. I'll just revert the patch and leave patching up all the places breaking true 32bpp bitmaps to whoever would feel bored enough to spend the effort on it.
Comment 8 Commit Notification 2020-01-27 14:59:35 UTC
Luboš Luňák committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/9bc731524b3c5cc809ca4573daa316173a5ec13a

Revert "avoid needless 32bpp->24+8bpp conversion in png writer" (tdf#130128)

It will be available in 6.5.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 9 Xisco Faulí 2020-01-28 09:06:42 UTC
Verified in

Version: 7.0.0.0.alpha0+
Build ID: aef7feb3e695ecf6d411f0777196dcc4281e201a
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3; 
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded