Description: Slides nearly black and unreadable when exported to PNG with transparency enabled Steps to Reproduce: 1.Open attached file 2. Click File -> Export 3. Select PNG 4. Click save 5. Click OK Actual Results: Slides nearly black and unreadable Expected Results: Slides should be exported the same way LibO 5.0.2.2 does Reproducible: Always User Profile Reset: No Additional Info: Found in Version: 5.4.0.0.alpha0+ Build ID: 99eed82939999d9a9689788a4134dd05d5c20c5a CPU Threads: 4; OS Version: Windows 6.19; UI Render: default; TinderBox: Win-x86@42, Branch:master, Time: 2017-01-14_23:37:40 Locale: nl-NL (nl_NL); Calc: CL and in Version: 5.0.6.3 Build ID: 490fc03b25318460cfc54456516ea2519c11d1aa Locale: nl-NL (nl_NL) but not in Version: 5.0.2.2 Build ID: 37b43f919e4de5eeaca9b9755ed688758a8251fe Locale: en-US (nl_NL) User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0
Created attachment 130470 [details] Example file
Confirmed in Version: 5.4.0.0.alpha0+ Build ID: 36afb355ac37122d32d624db079def123ef548a2 CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; VCL: gtk3; Locale: ca-ES (ca_ES.UTF-8); Calc: group
281611bcbe466cc1fd08ad39c8a664b92322d27a is the first bad commit commit 281611bcbe466cc1fd08ad39c8a664b92322d27a Author: Norbert Thiebaud <nthiebaud@gmail.com> Date: Wed Mar 9 00:46:39 2016 -0800 source f3ff67d3c3047de3ad43f8bb3f805d82eaef0479 # bad: [86cb9d229718f48f9538032b80037238ea79e8a5] source 78223678b7513ffe46804cb08f2dc5bc899b2bab # good: [9ff0a94931d5aba1e838c680c9604562eb2e71e2] source 76ec54e8c9f3580450bca85236a4f5af0c328588 git bisect start '86cb9d229718f48f9538032b80037238ea79e8a5' '9ff0a94' # bad: [f5479928f74d40ebd332b0d23929c59bbf6fa411] source b5d7b60fe3c0befb07ba739b0168bfc17851667f git bisect bad f5479928f74d40ebd332b0d23929c59bbf6fa411 # bad: [122228e8fa47941375b9fcb3b5c41ee4945880cb] source 7c0f6b9d0fb8d7d9e54865ccf1047bb8f8148101 git bisect bad 122228e8fa47941375b9fcb3b5c41ee4945880cb # good: [ac578e55fcf0b573382291810d43e94703fa0077] source 4943ee042ac487bc9be4477fed7effa8ea9f74d4 git bisect good ac578e55fcf0b573382291810d43e94703fa0077 # bad: [64ce7f0568248e7fa02fe8c59e37dea1fe80f434] source 8fb170cbe929fcbf85b24284bf31ec6b06150fbe git bisect bad 64ce7f0568248e7fa02fe8c59e37dea1fe80f434 # good: [a287f76f68517ca3a34bdb0acdf918697209f265] source 74040d447912eff5f7366b8ae61244ad101000dc git bisect good a287f76f68517ca3a34bdb0acdf918697209f265 # good: [1b11c126f5d167c54ee01cbfa810fd9010505125] source def71473d25e88729c644e35523d267c8cd04e57 git bisect good 1b11c126f5d167c54ee01cbfa810fd9010505125 # good: [c2e0f20b7865e51c29df993d03072011ea88a89e] source 3fd13a33670e8526bfe32bd4af83315cb35db697 git bisect good c2e0f20b7865e51c29df993d03072011ea88a89e # bad: [ab5dc093c260c701ca701096b25c13d2a0e524ba] source bd2bf6bd559163389d1e6b6b948fc29cee5f13f5 git bisect bad ab5dc093c260c701ca701096b25c13d2a0e524ba # good: [982ead95c22ca2cda7d3931f9439d54744bd69ed] source b2f5336b08b5f638f890a626eb2aeefaf499a79b git bisect good 982ead95c22ca2cda7d3931f9439d54744bd69ed # bad: [281611bcbe466cc1fd08ad39c8a664b92322d27a] source f3ff67d3c3047de3ad43f8bb3f805d82eaef0479 git bisect bad 281611bcbe466cc1fd08ad39c8a664b92322d27a # good: [3ccc629b735d74b40461d9c0526341a0d51ab9b9] source 3231e5c3626e5a194de0cc521606df54318117f4 git bisect good 3ccc629b735d74b40461d9c0526341a0d51ab9b9 # good: [3a550df1edb427e76ee0644c0f7a598055decad7] source 01ffe26fdf1c4575cffdf64468e3c1c996a2d200 git bisect good 3a550df1edb427e76ee0644c0f7a598055decad7 # first bad commit: [281611bcbe466cc1fd08ad39c8a664b92322d27a] source f3ff67d3c3047de3ad43f8bb3f805d82eaef0479
Bibisect points to the commit referenced below. Adding Cc: to Armin Le Grand, please take a look. https://cgit.freedesktop.org/libreoffice/core/commit/?id=f3ff67d3c3047de3ad43f8bb3f805d82eaef0479 author Armin Le Grand <Armin.Le.Grand@cib.de> 2016-03-02 16:21:10 (GMT) committer Michael Stahl <mstahl@redhat.com> 2016-03-02 21:29:48 (GMT) "tdf#96922 Suppress EditView PageVisuailsation in GraphicExporter"
** Please read this message in its entirety before responding ** To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from http://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to 'inherited from OOo'; 4b. If the bug was not present in 3.3 - add 'regression' to keyword Feel free to come ask questions or to say hello in our QA chat: https://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
Dear Telesto, To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to 'inherited from OOo'; 4b. If the bug was not present in 3.3 - add 'regression' to keyword Feel free to come ask questions or to say hello in our QA chat: https://kiwiirc.com/nextclient/irc.freenode.net/#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
Maybe double to tdf#122155, same commit identified
Just for the record after eed83764088bfdfcc6513778f7dc83d649f550a3, I got: a) the png seems ok with "Save transparency" is disabled b) empty transparent PNG if "Save transparency" is enabled so still KO
Yes, case (b) *somehow* does not export PageBackground -> all visible objects are on MasterPage, none is on the page directly...
Well, there are two options: (a) in the save-dialog (file-dialog), choose 'selection' or not (b) in the PNG-options dialog, choose 'Save transparency' or not not b -> all OK b -> fully transparent PNG Thus the problem seems (b). (a) has no effect, probably because there is no selection (and none possible - no objects on the page, only on MasterPage) Will take a look what makes the difference...
Diff is 'mbTranslucent' in ExportSettings (rSettings) of GraphicExporter::GetGraphic. This represents (b). If false, line 638 ff is used, else 697 ff. The if-statement to decide is: // generate a bitmap to convert it to a pixel format. // For gif pictures there can also be a vector format used (bTranslucent) if ( !bVectorType && !rSettings.mbTranslucent ) The comment obviously 'mixes' vector format (for gif...?) with transparency, so very strange already. If true (1), a pixel representation is created using CreatePageVDev and it's impl, that seems to correctly take care of MasterPage(s) If false (2) the comment says // create a metafile to export a vector format and a metafile is created. Right at the end there is if( rSettings.mbTranslucent ) { Size aOutSize; aGraphic = GetBitmapFromMetaFile( aGraphic.GetGDIMetaFile(), CalcSize( rSettings.mnWidth, rSettings.mnHeight, aNewSize, aOutSize ) ); } which then *also* creates a bitmap graphic. That metafile stuff seems - *not* to handle a MasterPage & it's content correctly - *or* the conversion to bitmap just goes wrong... The question is why for true == rSettings.mbTranslucent the conversion is *forced* to metafile creation at all, thus (2) when (1) seems to work fine, and - the target is no vector format anyways...?
The metafile for (2) only contains 8 actions, mainly push/pop & clip stuff -> empty. This is correct for only the page due to having no objects, but definitely does not contain the MasterPage objects...
false == rDisplayInfo.GetPageProcessingActive in ViewObjectContactOfMasterPageDescriptor::isPrimitiveVisible. That comes from aDisplayInfo.SetPageProcessingActive(rView.IsPagePaintingAllowed()); // #i72889# in SdrPageWindow::RedrawAll. That again is ue to // tdf#96922 completely deactivate EditView PageVisualization, including // PageBackground (formerly 'wiese'). pView->SetPagePaintingAllowed(false); in GraphicExporter::GetGraphic::724. This *should* be true (what is the default, so not set to false), but as can be seen fixed another bug which I would have to check...?
BTW, good proof of concept for comment 4 already showing the right relevant change :-)
After thinking a while about it, I would say the following: The granularity of 'hiding' page content is just not fine enough. The used 'SetPagePaintingAllowed' disables the whole stuff in ViewContactOfSdrPage, except page hierarchy itself. NOTE: The 11 sub-VOCs in ViewContactOfSdrPage are always created, their visibility & what primitives they produce depends on the VOC-implementations. Thus, true == SetPagePaintingAllowed allows all to be 'painted' (better: to create primitives), additionally dependent on 'old' settings at the SdrView which are acessed using the OC-abstraction (which replaces the view). This 'paints' all the VOCs dependent on other additional settings. false == SetPagePaintingAllowed does OTOH disable all of them, except PageHiearchy. It is used in the old fix to disable ViewContactOfPageBackground. That works, but also disables case '3' which is the MasterPage content. Content is: 0- ViewContactOfPageBackground 1- ViewContactOfPageShadow 2- ViewContactOfPageFill 3- (ViewContactOfMasterPage) 4- ViewContactOfOuterPageBorder 5- ViewContactOfInnerPageBorder 6- ViewContactOfGrid (back) 7- ViewContactOfHelplines (back) 8- (ViewContactOfPageHierarchy) 9- ViewContactOfGrid (front) 10 - ViewContactOfHelplines (front) 11 -?!?!? also ViewContactOfHelplines ?!? NOTE: Someone seems to have changed this, so now 10 && 11 are double, so in principle, if helplines are at front, they should be painted double (?) which is an error. Have to check that, too... What we want - and what was intended with SetPagePaintingAllowed - is to disable all 'page decoration' things which I would define as 0 to 2, 4 to 7, 9 to 10 or the other way around, 3 and 8 are *not* page decoration and should always be created, while the others are and should be suppressed when false == SetPagePaintingAllowed. So for now it should be fixed by: - always create (3) - ViewContactOfMasterPage, MasterPage content - rename SetPagePaintingAllowed to something with 'page decoration' to make clearer what it means - move it's access to OC (similar to e.g. 'IsPreviewRenderer'), remove *PageProcessingActive from DisplayInfo Will try that...
Works pretty as expected, so works well. One caveat: I 1st thought ssth is *wrong* but fact is that for the test file the BG on the MasterPage is a Metafile and the gaps btwn the colore objects is *not* transparent, but *filled* white -> no transparency gets created when using 'transparency' in the dialog. - I tried to 'break' that metafile in MasterView, did not work (another error?) - Cut/paste to regular page, also no 'break' offered - Just 'move' it then on masterpage so areas are 'uncovered' -> works NOTE: The mbTranslucent in GraphicExporter::GetGraphic and that it forces the way over metafile is *bad* (but works): - It works since GetBitmapFromMetaFile uses convertToBitmapEx from drawinglayer/source/tools/converters.cxx, so it *handles* transparency correct - SdrObjects get converte to Primitives, then to Metafile and for painting to Primitives *again*. This is *highly inefficient* and hosts the possible massive quality loss on that double conversion -> All that GraphicExporter::GetGraphic is *old* an should be re-implemented. It *should* just collect SdrObjects and Primitives from these, then *directly* convert those primitives to needed format (metafile or bitmap) using primitives ... ARGH! Also relevant: When fixing this *all* previously involved errors have also to be checked (!)
One more relevant point: To not change any behavior by accident it is necessary to also control MasterPage content handling from the beginning - all places where it was set to false before should also disable MasterPage content. Thus I will also have to add a flag for this ASAP...
Adapted changes, works as expected, except that export to gif with transparency produces an unreadable gif. Getting a plain master to see if that's caused by my changes. Since I already checked that the BitmapEx is correct I doubt that...
Same result with Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community Build ID: 41d8bb928231372f3ef08ce4ba3ea91b17e3ae29 CPU threads: 16; OS: Linux 5.19; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US Calc: threaded -> not caused by my changes. Will put solution on gerrit...
Solution on gerrit: https://gerrit.libreoffice.org/c/core/+/154301 Let's see if that will go through the tests
NOTE: This is a working solution, but GraphicExporter::GetGraphic should really be re-designed to work on primitives to avoid double conversion (see comment 16). Problem is that that part is used for multiple purposes, so dangerous to touch. When redoing it needs to deliver exactly the same content as it does now
Armin Le Grand (allotropia) committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/3996eed1870ced736d9f4a01550f5c9f0568edfa tdf#105362 better support for transparency in PNG & GIF export 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.
Xisco Fauli committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/4648764378f42df7dee4a4cf7d1614ee64e1d1a3 tdf#105362: sd_png_export: Add unittest 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.
*** Bug 123973 has been marked as a duplicate of this bug. ***
*** Bug 135258 has been marked as a duplicate of this bug. ***