Bug 101106 - PNG export of full page in Draw does not respect margins
Summary: PNG export of full page in Draw does not respect margins
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
5.1.2.1 rc
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Graphics-Export
  Show dependency treegraph
 
Reported: 2016-07-25 03:50 UTC by Valter Fukuoka
Modified: 2020-07-06 05:49 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Original .odg document... (8.61 KB, application/vnd.oasis.opendocument.graphics)
2016-07-26 23:21 UTC, Valter Fukuoka
Details
Correctly exported JPG (20.35 KB, image/jpeg)
2016-07-26 23:22 UTC, Valter Fukuoka
Details
Difference (exported) as PNG (22.18 KB, image/png)
2016-07-26 23:23 UTC, Valter Fukuoka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Valter Fukuoka 2016-07-25 03:50:55 UTC
LibreOffice Draw.
OS: Debian Jessie 8.5 GNOME Desktop

When exporting a draw as .PNG, the exported area is restricted to the "within margin" area, but when exporting as .JPG, the exported area is the PAPER SIZE area...

Not sure if it is a planned feature, but it will be nice to have the possibility to export .png and .jpg resulting the same (in this case exporting the entire PAPER SIZE area.
Comment 1 Heiko Tietze 2016-07-25 08:10:43 UTC
Exporting the left-most arrow from attachment 126392 [details] as png and jpg results in both cases in 183x189 pixels, when I mark _selection_ in the export dialog. Please double-check that you set it correctly.

It's clearly a usability issue, and there are some enhancement request regarding file export (cf. bug 100467).
Comment 2 Valter Fukuoka 2016-07-26 23:21:36 UTC
Created attachment 126421 [details]
Original .odg document...

Original .odg document...
Comment 3 Valter Fukuoka 2016-07-26 23:22:07 UTC
Created attachment 126422 [details]
Correctly exported JPG

Correctly exported JPG
Comment 4 Valter Fukuoka 2016-07-26 23:23:18 UTC
Created attachment 126423 [details]
Difference (exported) as PNG

Using the same procedure to export to .PNG creates a different result...
Comment 5 Heiko Tietze 2016-07-27 07:20:06 UTC
/confirmed (thanks for adding the example)
Version: 5.3.0.0.alpha0+ (x64)
Build ID: f536a83d51443d19dba58157cea28fb67a090e02
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; 
TinderBox: Win-x86_64@62-TDF, Branch:MASTER, Time: 2016-06-13_01:19:21
Locale: de-DE (de_DE)

The issue becomes more striking when you shrink the page height: it results in a squeezed text (export the complete image to PNG). The sample document has a colored background and large margins (5cm). And those are not respected.

Changing the subject accordingly (was: Export .PNG differ from export .JPG) and moving the ticket to component filters. It's an issue for Draw and Impress but not in Writer.
Comment 6 QA Administrators 2018-07-25 02:40:38 UTC Comment hidden (obsolete)
Comment 7 Bart Besseling 2020-07-06 05:47:19 UTC
I create a new document using LO Draw.
The default page is 8.5" by 11" in portrait orientation.
The page has the default left, right, top and bottom margins of 0.39", leaving a usable area of 7.72" by 10.22".
I create a graphic, e.g. a square box, of 3.24" by 2" against the top and left margins.
I select File->Export and save the entire page as PNG type.
The width and height are 8.5" by 11" as expected.
The default resolution is 96 pixels per inch which is fine.
I select compression "1" and use the defaults of interlaced and save transparency.
The PNG IHDR chunk confirms the image is 816 by 1056 pixels, which at 96ppi is 8.5" by 11".
The square box graphic I added is now aligned to the top-left of the page image, not to the top left margins I set on the page where I drew it.
The box itself is now rasterized to 344 by 208 pixels. At the 96ppi I selected, this should have been 311 by 192.
Draw exports the area inside the page margins to a PNG to the size of the entire page, scaling it up.
Comment 8 Bart Besseling 2020-07-06 05:49:13 UTC
(In reply to Bart Besseling from comment #7)
> I create a new document using LO Draw.
> The default page is 8.5" by 11" in portrait orientation.
> The page has the default left, right, top and bottom margins of 0.39",
> leaving a usable area of 7.72" by 10.22".
> I create a graphic, e.g. a square box, of 3.24" by 2" against the top and
> left margins.
> I select File->Export and save the entire page as PNG type.
> The width and height are 8.5" by 11" as expected.
> The default resolution is 96 pixels per inch which is fine.
> I select compression "1" and use the defaults of interlaced and save
> transparency.
> The PNG IHDR chunk confirms the image is 816 by 1056 pixels, which at 96ppi
> is 8.5" by 11".
> The square box graphic I added is now aligned to the top-left of the page
> image, not to the top left margins I set on the page where I drew it.
> The box itself is now rasterized to 344 by 208 pixels. At the 96ppi I
> selected, this should have been 311 by 192.
> Draw exports the area inside the page margins to a PNG to the size of the
> entire page, scaling it up.

I installed a new instance of LibreOffice version 6.4.5.2 for 64-bit Windows 10 from the web site today.