[Libreoffice-bugs] [Bug 135348] New: Distorted images when exporting to PNG (and possibly other formats) with transparency

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Fri Jul 31 17:14:09 UTC 2020


https://bugs.documentfoundation.org/show_bug.cgi?id=135348

            Bug ID: 135348
           Summary: Distorted images when exporting to PNG (and possibly
                    other formats) with transparency
           Product: LibreOffice
           Version: 6.4.5.2 release
          Hardware: All
                OS: Windows (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Draw
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: muriloholtman at gmail.com

Description:
When exporting to PNG (and possibly other raster formats), Draw proceeds to
crop the image to its most compact shape, excluding all transparent space
around it, and the produced image has the wrong width:height ratio (i.e. is
distorted).

Steps to Reproduce:
Please consider the following sequence, numbered as per the attached
screenshots.

1. I created this simple figure: a gray rectangle with a circle inside, placed
at the recangle's right edge. No borders, only fill.
2. I took the outer rectangle and made it transparent.
3. I selected both shapes and proceeded to export to PNG.
4. Checked the "Selection" box in the save dialog, since I only want to export
the selected shapes.
5. In the "PNG Options" dialog that pops up, I set the resolution to something
fixed (e.g. 100 px/cm) and set one of the dimensions (in this case, width) to
some fixed value (e.g. 1 cm); the other dimension gets adjusted automatically
to keep it in proportion. Transparency is enabled too.
NOTE: the problem happens even if I don't touch these fields and leave them at
their default values.
6. The resulting image is distorted out of ratio; the original circle now looks
like an ellipse. Draw attempts to crop the image down to its most compact shape
(excluding all transparent space around it), but still uses the width:height
ratio of the originally selected shapes (from step 3).


Actual Results:
Generated PNG raster image is distorted/out of proportion in relation to
original drawing.

Expected Results:
Aside from the fact that the wrong proportions are used (which is obviously a
bug), I believe the export operation should not crop down to the most compact
shape (excluding all transparent space around it), since it's very useful to be
able to place a drawing inside a transparent rectangle/square and then export
to a raster format with the correct overall pixel size.



Reproducible: Always


User Profile Reset: No



Additional Info:
I have tried this in LibreOffice Draw 6.4.5.2 portable (the latest official
portable version available at the libreoffice.org website) on Windows 10, since
unfortunately I can't install the full version in my IT-managed work computer.

This used to work just fine in 5.2.7 (unfortunately the only old version to
which I can compare right now).

This bug is very annoying to me, since I need to export a large set of images
with transparent space around them (so that they end up with correct pixel
sizes) and I have no easy workaround to this issue. 

NOTE: this might be related to bug #134775, but I'm not sure.

I appreciate very much if you would consider fixing this.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20200731/e6e8296c/attachment.htm>


More information about the Libreoffice-bugs mailing list