Bug 154168 - FILESAVE: Export selection to .PNG without transparency fails
Summary: FILESAVE: Export selection to .PNG without transparency fails
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
7.5.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:24.2.0 target:7.6.0.0.beta2 ta...
Keywords: bibisected, bisected, regression
: 155281 155524 155844 (view as bug list)
Depends on:
Blocks: Graphics-Export
  Show dependency treegraph
 
Reported: 2023-03-13 17:39 UTC by Rainer Bielefeld Retired
Modified: 2023-06-15 13:59 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
Simple Sample Document (9.96 KB, application/vnd.oasis.opendocument.graphics)
2023-03-13 17:39 UTC, Rainer Bielefeld Retired
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Bielefeld Retired 2023-03-13 17:39:39 UTC
Created attachment 185933 [details]
Simple Sample Document

Steps how to reproduce with Server Installation of Version: 7.6.0.0.alpha0+ (X86_64) 
Build ID: 0484a9a3f5e2ecb678f6fb41bbb251529e89c00d
CPU threads: 12; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: CL threaded – Special new User Profile for testing

0. Create a DRAW document simply containing a Text Box  – Or open attached
   sample document
1. <cntrl+y> to select al
2. Menu  ˋFile → Wxport... → Type filename if necessary → Select Filetype PNG
   → Check 'Automatic File Name Extension' → Check 'Selection' 
   → Radiobutton 'Modify Dimensions' → Uncheck all the rest → [Ok]ˊ 
   » A .png with you name will be created
     But it will have size "0 Bytes"                    😥

Additional Info:
----------------
a) Other file types (I tested .bmp, .gif, .jpg, .tif) works fine, creates
   bitmap drawings with contents which can be opened with other Graphic
   APPs without problems
b) png Export of complete page works fine, creates .png with 8KB
Comment 1 Rainer Bielefeld Retired 2023-03-13 17:42:30 UTC
c) I did not find an obious DUP with Query <https://bugs.documentfoundation.org/buglist.cgi?cmdtype=dorem&remaction=run&namedcmd=DUPs154168&sharer_id=19321>
Comment 2 Rainer Bielefeld Retired 2023-03-13 17:43:36 UTC
e) Also REPRODUCIBLE with Installation of Version: 7.5.0.1 (X86_64)  
Build ID: 77cd3d7ad4445740a0c6cf977992dafd8ebad8df
CPU threads: 12; OS: Windows 10.0 Build 19044; 
UI render: default; VCL: win – Locale: de-DE (de_DE); UI: de-DE
Calc: threaded |  Elementary (SVG)  Theme  |  Normal UserProfile
Comment 3 Rainer Bielefeld Retired 2023-03-13 17:47:46 UTC
d) Still worked fine with 4.0.0, more tests to narrow down 
   root version later!
Comment 4 Rainer Bielefeld Retired 2023-03-13 18:50:25 UTC
d11) Still worked fine with Server Installation of Version: 7.4.0.0.alpha0+ (x64)  Build ID ae36ee4f3aa544e53e2edad93d6d79160b27bc9d
CPU threads: 12; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-US  |  Calc: CL  |  Colibri Theme  |  Special devUserProfile

d12) Still worked fine with Server Installation of Version: Version: 7.2.5.2 (x64)  Build ID 499f9727c189e6ef3471021d6132d4c694f357e5
CPU threads: 12; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE  |  Calc: CL  |  Elementary Theme  |  Special devUserProfile

d13) Still worked fine with Server Installation of Version Version: 7.0.0.1 (x64),   Build ID: 04ba7e3f1e51af6c5d653e543a620e36719083fd
CPU-Threads: 12; BS: Windows 10.0 Build 19044; UI-Render: Skia/Vulkan; VCL: win
Locale: de-DE (de_DE); UI: de-DE  |  Calc: CL  |  Colibri Theme

d14) Still worked fine with Version: 6.4.7.2 (x86)
Build-ID: 639b8ac485750d5696d7590a72ef1b496725cfb5
CPU-Threads: 12; BS: Windows 10.0 Build 19044; UI-Render: GL; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
Calc: CL

d15) Still worked fine with  6.0.7.3 (x64)
Build-ID: dc89aa7a9eabfd848af146d5086077aeed2ae4a5
CPU-Threads: 12; BS: Windows 10.0; UI-Render: Standard; 
Gebietsschema: de-DE (de_DE); Calc: CL

---

e11) Already REPRODUCIBLE with Server Installation of 
Version: 7.5.0.0.alpha0+  Build ID: 2a7fcaf582df3ada57ca519b50e29011973a1b6f
CPU-Threads: 12; BS: Windows 10.0 Build 19044; UI render: default; 
VCL: win | Locale: de-DE (de_DE); UI: en-US
Calc: Calc: threaded |  Elementary Theme  |  Special devUserProfile  (based on my normal one)

So introduced somewhere between 7.4 amd 7.5?
Comment 5 Stéphane Guillou (stragu) 2023-03-13 20:38:33 UTC
Reproduced on Linux:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 98f35cf85ee66e995610fec92ea5224fbf28dff3
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

I noticed that the setting that matters is Transparency. Turning it off results in a 0-byte file.
Comment 6 Stéphane Guillou (stragu) 2023-03-13 20:53:22 UTC
Bibisected with linux-64-7.5 repo to first bad commit 47b810ff80dca560f10916888f8ecbf3574ee357 which points to core commit:

commit 1d548a2bc70e0b38e32ccae8b15b04bda84f3576
author	offtkp <parisoplop@gmail.com>	Sat Jul 16 19:10:19 2022 +0300
committer	Tomaž Vajngerl <quikee@gmail.com>	Tue Jul 19 13:05:03 2022 +0200
parent 4d9e9ff5f4cb199844eb1d2b4000bb837089347f
Replace old png writer in graphicfilter.cxx
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137132

Paris, can you please have a look?
Comment 7 KC 2023-05-14 11:57:17 UTC
*** Bug 155281 has been marked as a duplicate of this bug. ***
Comment 8 raal 2023-05-27 16:31:04 UTC
*** Bug 155524 has been marked as a duplicate of this bug. ***
Comment 9 Paris Oplopoios 2023-06-10 18:04:27 UTC
Hello,

I tried to reproduce this bug in master and couldn't.

Can any of the above posters who confirmed this bug check if they can still reproduce it?

Thanks
Comment 10 Paris Oplopoios 2023-06-10 18:41:02 UTC
Nevermind, reproduced. I will push a commit and you can tell me if it fixes that.
Comment 11 Commit Notification 2023-06-10 23:14:23 UTC
Paris Oplopoios committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/7588c1f33cdaab58a6b84f4f4e75922c5d4a8a7f

tdf#154168 Export no transparency PNGs correctly

It will be available in 24.2.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 12 Commit Notification 2023-06-13 21:21:12 UTC
Paris Oplopoios committed a patch related to this issue.
It has been pushed to "libreoffice-7-6":

https://git.libreoffice.org/core/commit/e691869486cd4ee4ee1dfb8f7a41440f7f6500fd

tdf#154168 Export no transparency PNGs correctly

It will be available in 7.6.0.0.beta2.

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 13 Stéphane Guillou (stragu) 2023-06-15 09:01:58 UTC
*** Bug 155844 has been marked as a duplicate of this bug. ***
Comment 14 Stéphane Guillou (stragu) 2023-06-15 09:09:23 UTC
Paris, I just verified the fix  with exporting a Calc selection without transparency, in:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: ec60d354359067f8c5c686ef2239ee705916de43
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

Thank you!
I think you can mark as resolved - fixed.

It would be great to get it backported to 7.5 too, as we already have 3 duplicate reports and it affects all components, not just Draw. I tried cherrypicking on gerrit (first time I try it) but I get a merge conflict. Can you please have a look?
Comment 15 Commit Notification 2023-06-15 13:02:37 UTC
Paris Oplopoios committed a patch related to this issue.
It has been pushed to "libreoffice-7-5":

https://git.libreoffice.org/core/commit/21fa75ced1f82b5dd87874a789a13153c09cd283

tdf#154168 Export no transparency PNGs correctly

It will be available in 7.5.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.
Comment 16 Paris Oplopoios 2023-06-15 13:03:02 UTC
Backported to 7.5 too, marking as fixed.
Comment 17 Stéphane Guillou (stragu) 2023-06-15 13:59:27 UTC
Thanks! :)