Bug 89828 - Image Export crops based on margins instead of page boundaries when Save transparency checked
Summary: Image Export crops based on margins instead of page boundaries when Save tran...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 92945 101106 128731 158491 (view as bug list)
Depends on:
Blocks: Page-Margins Graphics-Export
  Show dependency treegraph
 
Reported: 2015-03-04 20:57 UTC by tmacalp
Modified: 2024-06-18 10:30 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Example drawing showing edge of margins (11.12 KB, application/vnd.oasis.opendocument.graphics)
2015-03-04 21:14 UTC, tmacalp
Details
Export from example document showing current behavior in 4.4.1.2 (35.08 KB, image/png)
2015-03-04 21:17 UTC, tmacalp
Details
Export from example document showing behavior in 4.3.5.2 (49.80 KB, image/png)
2015-03-04 21:20 UTC, tmacalp
Details
Sample ODG to test export, and documenting the history of transparency + margins in export (105.32 KB, application/vnd.oasis.opendocument.graphics)
2024-06-18 09:49 UTC, Stéphane Guillou (stragu)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tmacalp 2015-03-04 20:57:36 UTC
In LibreOffice 4.4.1.2, when using draw to export certain images that supports transparency (at least png and gif) and "Save transparency" is checked, the resulting image is cropped to page MARGINS instead of page BOUNDARIES.  

When you perform the same process unchecking "Save transparency," the resulting image is cropped by page boundaries as expected.  Also, at some point after 4.2.8, the "Save transparency" setting is now broken and a solid background color is always used.

Steps to reproduce:
1. Create new drawing
2. Create a shape that completely covers area within margins
3. Make sure object is not selected
4. File -> Export
5. Select png and click "Export..."
6. Uncheck "Save transparency" and click OK
7. View the image: Note that everything is correct.  The background is solid and extends to the full page boundary.
8. File -> Export
9. Select png again and click "Export..." (note that file type annoyingly wasn't saved from last use)
10. Leave "Save transparency" checked (note that the dialog annoyingly forgot our last state of being unchecked)
11. View the image:

Expected:
We should have an image that extends to the full page boundaries but has a transparent background, except for our shape

Actual:
We have an image that is cropped down to the page margins, showing no page margins.  We can't really see it in this example, but the background is not transparent.  It is white, or whatever color we have set for our "Document Background" theme.

I tested this as the behavior in LO 4.4.1.2 using 32bit Fedora17.  Things get weirder in previous versions.

LO 4.2.8.2: In this version the background is actually transparent, as we selected.  Unfortunately, the boundary is even more screwed up.  It still cropped based on the page margins, but then it, for some reason, attempts to apply a blank transparent blank space, the thickness of the page margin along the bottom and right sides of the exported png.  So our resulting image is even more chopped off than the page margins...

LO 4.3.5.2: Almost exactly the same as the behavior described above in 4.2.8.2, except now transparency is broken!  The correct transparent background has been replaced by white.  The only section that remains transparent is the chopped off swath along the bottom and right of the image.
Comment 1 tmacalp 2015-03-04 21:14:27 UTC
Created attachment 113894 [details]
Example drawing showing edge of margins

I've attached an example drawing that can be used to show the crop boundaries.
Comment 2 tmacalp 2015-03-04 21:17:10 UTC
Created attachment 113895 [details]
Export from example document showing current behavior in 4.4.1.2

Here is an exported png showing the current behavior of cropping based on the margins instead of page boundaries.  Also, you'll note that the png has a solid white background instead of a transparent one.
Comment 3 tmacalp 2015-03-04 21:20:48 UTC
Created attachment 113896 [details]
Export from example document showing behavior in 4.3.5.2

Here is a png export from 4.3.5 that shows the weird transparent blank margin area.
Comment 4 Buovjaga 2015-03-18 11:35:24 UTC
Reproduced with attachment 113894 [details].
4.2.0 behaves the same as 4.2.8 in the description.

Win 7 Pro 64-bit, LibO Version: 4.4.1.2
Build ID: 45e2de17089c24a1fa810c8f975a7171ba4cd432
Locale: fi_FI

Version: 4.5.0.0.alpha0+
Build ID: 16b8fbb2e0c72ce321c9f569284f4ef37339af2c
TinderBox: Win-x86@62-TDF, Branch:MASTER, Time: 2015-03-10_09:56:13
Locale: fi_FI

Ubuntu 14.10 64-bit 
Version: 4.2.0.4
Build ID: 05dceb5d363845f2cf968344d7adab8dcfb2ba71
Comment 5 tommy27 2016-04-16 07:23:01 UTC Comment hidden (obsolete)
Comment 6 tmacalp 2016-04-18 03:02:51 UTC
I can still reproduce in:

Version: 5.1.2.2.0+
Build ID: 5.1.2.2 Arch Linux build-1
CPU Threads: 6; OS Version: Linux 4.5; UI Render: default; 
Locale: en-US (en_US.UTF-8)
Comment 7 QA Administrators 2018-02-08 03:36:26 UTC Comment hidden (obsolete)
Comment 8 QA Administrators 2020-02-09 03:42:22 UTC Comment hidden (obsolete)
Comment 9 QA Administrators 2022-02-09 03:41:16 UTC Comment hidden (obsolete)
Comment 10 QA Administrators 2024-02-10 03:13:28 UTC Comment hidden (obsolete)
Comment 11 Stéphane Guillou (stragu) 2024-06-18 04:39:04 UTC
(In reply to tmacalp from comment #0)
> Also, at some
> point after 4.2.8, the "Save transparency" setting is now broken and a solid
> background color is always used.
That 4.3 regression was bug 96922, fixed in LO 5.0.6 and above.
I'm removing the mention of that regression from the summary.

The issue with margins not included in image exports with transparency turned on is inherited, I reproduce it with OOo 3.3 (tested with GIF).

It is still reproduced in a recent trunk daily build:

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

This issue is likely related to the aspect ratio regression in bug 122155.
Comment 12 Stéphane Guillou (stragu) 2024-06-18 04:42:24 UTC
*** Bug 92945 has been marked as a duplicate of this bug. ***
Comment 13 Stéphane Guillou (stragu) 2024-06-18 09:49:37 UTC
Created attachment 194793 [details]
Sample ODG to test export, and documenting the history of transparency + margins in export

Noting bug 37682, which was fixed in LO 4.4 / 5.0. That one was the inherited issue of part of the view _inside_ the margins not being visible in the export (see difference between slides 5 and 6 in the attachment).

The attachment shows that the issue of margins being excluded from an export with transparency (tracked here) exists since OOo times.
Comment 14 Stéphane Guillou (stragu) 2024-06-18 10:09:47 UTC
*** Bug 128731 has been marked as a duplicate of this bug. ***
Comment 15 Stéphane Guillou (stragu) 2024-06-18 10:13:01 UTC
*** Bug 101106 has been marked as a duplicate of this bug. ***
Comment 16 Stéphane Guillou (stragu) 2024-06-18 10:30:51 UTC
*** Bug 158491 has been marked as a duplicate of this bug. ***