Bug 147119 - Impossible in 7.4 to export a PNG with a transparent background (no background defaults to white)
Summary: Impossible in 7.4 to export a PNG with a transparent background (no backgroun...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
7.4.0.0 alpha0+
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Armin Le Grand (allotropia)
URL:
Whiteboard: target:7.4.0 target:7.3.1
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Graphics-Export
  Show dependency treegraph
 
Reported: 2022-02-02 05:35 UTC by xordevoreaux
Modified: 2022-02-04 11:13 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Screen capture of Sims 4 Studio with properly exported PNG (121.01 KB, image/png)
2022-02-02 05:37 UTC, xordevoreaux
Details
Screen capture of Sims 4 Studio with PNG with no transparency (104.21 KB, image/png)
2022-02-02 05:39 UTC, xordevoreaux
Details
Proper PNG export with transparency (356.25 KB, image/png)
2022-02-02 05:40 UTC, xordevoreaux
Details
PNG export from 7.4 where transparency defaulted to white (674.17 KB, image/png)
2022-02-02 05:42 UTC, xordevoreaux
Details
LibreOffice Draw file (379.43 KB, application/vnd.oasis.opendocument.graphics)
2022-02-02 05:45 UTC, xordevoreaux
Details

Note You need to log in before you can comment on or make changes to this bug.
Description xordevoreaux 2022-02-02 05:35:46 UTC
Description:
Several usage cases for Draw for me involve "holes" in the exported PNG background where nothing at all renders, nothing at all, not even white. Those portions are transparent. 

In 7.4, #Bug 123973 is now fixed, but the fix has left exporting a PNG with any of the PNG's background as transparent impossible. "None" for a background is treated as solid white, and white < > transparent.  If I wanted white, I would have selected Color for the background and picked White from the color palette.

I've thousands of exported PNGs where I've used transparency. The fix for #Bug 123973 cannot be at the expense of never being able again to export PNGs with areas of the page transparent.

Steps to Reproduce:
1. Create a new Windows LO Draw file
2. Do nothing to the background of the page or the master, leave it set to "none"
3. Draw any shape on the page so that it does not extend over the entire page
4. Export as a PNG using the Transparency option

Actual Results:
The area around the shape on the exported PNG is white, when it should be transparent if I exported using transparency. A white background is being forced despite exporting with transparency.

Expected Results:
If I do nothing to the background, and do not export the PNG with transparency, it's okay for the background to default to white (even though it's still sitting there as "none).

---IF---- however, I choose to export the page as a PNG and select the transparency option during the import process, and my background is set to None, and my master background is set to None, the result should be any place where draw image or object appears should export transparent, not render white.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 5c138ac6a8334825ef171ac6291b66b277eb4288
CPU threads: 8; OS: Windows 10.0 Build 19044; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL


I will include a series of images showing the problem and how it's stopping me cold from using 7.4 for one particular use case scenario (I've many) that I use LO Draw.
Comment 1 xordevoreaux 2022-02-02 05:37:37 UTC
Created attachment 177973 [details]
Screen capture of Sims 4 Studio with properly exported PNG

This image shows clothing on a 3D mesh of a person.  Notice that skin is showing on the person. The area where there is no clothing but instead shows skin is where I have transparency set on the exported PNG (nothing should block the skin).
Comment 2 xordevoreaux 2022-02-02 05:39:10 UTC
Created attachment 177974 [details]
Screen capture of Sims 4 Studio with PNG with no transparency

This is the result of importing a PNG using 7.4 where transparency defaulted to white. Completely useless, as it renders the 3D model white where there should be skin.
Comment 3 xordevoreaux 2022-02-02 05:40:42 UTC
Created attachment 177975 [details]
Proper PNG export with transparency

This is the default texture from Sims 4 studio containing the necessary transparency (load it in Windows and you'll see the checkerboard pattern around the clothing where nothing at all is rendering, not even white).
Comment 4 xordevoreaux 2022-02-02 05:42:25 UTC
Created attachment 177976 [details]
PNG export from 7.4 where transparency defaulted to white

This is the default image from Sims 4 Studio imported into LO Draw and exported as a PNG with transparency, except... no transparency.  If you view the file in Windows, you'll see white rendered around the clothing rather than check boxes indicating alpha transparency. 

Not useful.
Comment 5 xordevoreaux 2022-02-02 05:45:32 UTC
Created attachment 177977 [details]
LibreOffice Draw file

This is the LibreOffice draw file that I used in 7.4 to export the PNG using transparency. Notice the background slide color is set to None and that View, Master, Background setting is also None, yet exporting the page as a PNG and selecting the transparency option during export renders the background white, not transparent.
Comment 6 Buovjaga 2022-02-02 08:17:29 UTC
Checked with linux-64-7.4 bibisect repo and indeed the cause is https://git.libreoffice.org/core/commit/87866def6bfe2ee91be34a5ce37b79d6da881617
Comment 7 Armin Le Grand (allotropia) 2022-02-02 08:49:02 UTC
So the fix for tdf#123973 had unexpected side-effects. I will revert that one ASAP and will have to fix it differently - now having another case to check hat may break here - what is a good finding of unexpected internal connectivity.
Comment 8 Armin Le Grand (allotropia) 2022-02-02 08:51:29 UTC
(In reply to Buovjaga from comment #6)
> Checked with linux-64-7.4 bibisect repo and indeed the cause is
> https://git.libreoffice.org/core/commit/
> 87866def6bfe2ee91be34a5ce37b79d6da881617

Hi, do you know if there is a simple way to revert those changes from tdf#123973, including the backports? Is it necessary to do all solo or is there some mechanism I do not know to do that (half-)automated...?
Comment 9 Buovjaga 2022-02-02 08:58:45 UTC
(In reply to Armin Le Grand from comment #8)
> (In reply to Buovjaga from comment #6)
> > Checked with linux-64-7.4 bibisect repo and indeed the cause is
> > https://git.libreoffice.org/core/commit/
> > 87866def6bfe2ee91be34a5ce37b79d6da881617
> 
> Hi, do you know if there is a simple way to revert those changes from
> tdf#123973, including the backports? Is it necessary to do all solo or is
> there some mechanism I do not know to do that (half-)automated...?

I guess first revert Xisco's test, then in a separate revert your own patch and backport the revert to 7-3 branch.
Comment 10 Xisco Faulí 2022-02-02 11:52:04 UTC
Hi Armin,
I reverted it in https://gerrit.libreoffice.org/c/core/+/129351 But I let the decision to push it to you, maybe you want to fix it instead...
Comment 11 Xisco Faulí 2022-02-02 12:39:21 UTC
(In reply to Xisco Faulí from comment #10)
> Hi Armin,
> I reverted it in https://gerrit.libreoffice.org/c/core/+/129351 But I let
> the decision to push it to you, maybe you want to fix it instead...

Unittest added in https://gerrit.libreoffice.org/c/core/+/129354
Comment 12 Armin Le Grand (allotropia) 2022-02-02 16:24:00 UTC
(In reply to Xisco Faulí from comment #11)
> (In reply to Xisco Faulí from comment #10)
> > Hi Armin,
> > I reverted it in https://gerrit.libreoffice.org/c/core/+/129351 But I let
> > the decision to push it to you, maybe you want to fix it instead...
> 
> Unittest added in https://gerrit.libreoffice.org/c/core/+/129354

Guys, you make my head spin - could we - someone - just revert the change, maybe the test, too, I do not know if that is needed...?
Jus tlet's go to the state before that change, I need to fix that definitely differently...
Comment 13 Xisco Faulí 2022-02-02 16:29:59 UTC
(In reply to Armin Le Grand from comment #12)
> (In reply to Xisco Faulí from comment #11)
> > (In reply to Xisco Faulí from comment #10)
> > > Hi Armin,
> > > I reverted it in https://gerrit.libreoffice.org/c/core/+/129351 But I let
> > > the decision to push it to you, maybe you want to fix it instead...
> > 
> > Unittest added in https://gerrit.libreoffice.org/c/core/+/129354
> 
> Guys, you make my head spin - could we - someone - just revert the change,
> maybe the test, too, I do not know if that is needed...?
> Jus tlet's go to the state before that change, I need to fix that definitely
> differently...

Hi Armin,
Then please give a +1 to https://gerrit.libreoffice.org/c/core/+/129351
Comment 14 Buovjaga 2022-02-02 16:50:14 UTC
(In reply to Xisco Faulí from comment #13)
> Hi Armin,
> Then please give a +1 to https://gerrit.libreoffice.org/c/core/+/129351

A separate revert has to be created for 7.3.1 (without the test)
Comment 15 Commit Notification 2022-02-03 10:11:36 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/028602a7fc0691958ade01c9bc7cd617e85203ac

tdf#147119:Revert "tdf#123973 fix missing MasterPage content in export"

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 16 Commit Notification 2022-02-03 16:00:15 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/789e22f7eb115d56351f19ec238a5c92798b0a4c

tdf#147119: sd_png_export_tests: Add unittest

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-02-04 11:13:07 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/7d9851c65c33865b995932e0d83cee815edcbbce

tdf#147119:Revert "tdf#123973 fix missing MasterPage content in export"

It will be available in 7.3.1.

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.