Bug Hunting Session
Bug 126319 - FILESAVE: exporting selection to bitmap formats produces distorted output
Summary: FILESAVE: exporting selection to bitmap formats produces distorted output
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
6.2.4.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2019-07-10 02:22 UTC by Christopher Chavez
Modified: 2019-07-19 08:50 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Test drawing used to produce example PNG files (9.81 KB, application/vnd.oasis.opendocument.graphics)
2019-07-10 02:23 UTC, Christopher Chavez
Details
PNG output for single text box (7.59 KB, image/png)
2019-07-10 02:24 UTC, Christopher Chavez
Details
PNG output for two text boxes (12.40 KB, image/png)
2019-07-10 02:24 UTC, Christopher Chavez
Details
PNG output for upper text box and circle (8.94 KB, image/png)
2019-07-10 02:25 UTC, Christopher Chavez
Details
PNG output for lower text box and circle (10.07 KB, image/png)
2019-07-10 02:26 UTC, Christopher Chavez
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Chavez 2019-07-10 02:22:18 UTC
Note that this issue also applies to Impress; not sure if I should have selected a different component.

Selecting objects and then doing File > Export, checking "selection", and saving to various bitmap image formats (bmp, png, jpeg, etc.) produces files that are distorted (i.e. incorrect aspect ratio): usually, the objects appear to be stretched vertically/compressed horizontally. Attempting to change the height/width options does not prevent this issue since changing one causes the other to be recalculated according to the (incorrect) aspect ratio.

Unfortunately, I'm not sure what the exact conditions for reproducing this are. At first, I believed this only occurred when selecting single text boxes, and not when selecting two text boxes or a text box plus a shape; but I have since been able to create distorted output for selections of multiple objects.

The attached examples are of a single text box, two offset identical text boxes, and each text box with a circle; all have some amount of distortion, but the single text box is the most noticeable example.

This issue seems to happen regardless of OS (have reproduced on Windows, Mac and Linux).

Earliest version I have tried so far which has this issue is 6.2.4; it does not appear to be present in 6.1.6 or earlier.
Comment 1 Christopher Chavez 2019-07-10 02:23:37 UTC
Created attachment 152694 [details]
Test drawing used to produce example PNG files
Comment 2 Christopher Chavez 2019-07-10 02:24:19 UTC
Created attachment 152695 [details]
PNG output for single text box
Comment 3 Christopher Chavez 2019-07-10 02:24:49 UTC
Created attachment 152696 [details]
PNG output for two text boxes
Comment 4 Christopher Chavez 2019-07-10 02:25:12 UTC
Created attachment 152697 [details]
PNG output for upper text box and circle
Comment 5 Christopher Chavez 2019-07-10 02:26:46 UTC
Created attachment 152698 [details]
PNG output for lower text box and circle
Comment 6 Regina Henschel 2019-07-10 22:09:45 UTC
It was OK in Version: 6.2.0.0.alpha0+ (x64)
Build ID: 215780a7eca23c1bfcde74958e10ae84ea12d506
CPU threads: 8; OS: Windows 10.0; UI render: default; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-08-15_22:56:00
Locale: de-DE (en_US); Calc: CL

It is broken in Version: 6.2.0.0.alpha1+ (x64)
Build ID: bf4fc97131147d25b18d088023262c977f0b2787
CPU threads: 8; OS: Windows 10.0; UI render: default; VCL: win; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-11-10_01:58:33
Locale: de-DE (en_US); UI-Language: en-US
Calc: CL

The glyphs are stretched to the box size, the space above and below the glyphs is missing. If you insert the produced image and compare it with the source, you see the distortion immediately.
Comment 7 raal 2019-07-19 08:50:19 UTC
This seems to have begun at the below commit.
Adding Cc: to Armin Le Grand; Could you possibly take a look at this one? Thanks

06599193348562f3e4878a9b149ad8caed7554fe is the first bad commit
commit 06599193348562f3e4878a9b149ad8caed7554fe
Author: Norbert Thiebaud <nthiebaud@gmail.com>
Date:   Fri Aug 17 12:33:05 2018 -0700

    source sha:046df0a876b3d948bb1e14443c00c180bc8cccaa

author	Armin Le Grand <Armin.Le.Grand@cib.de>	2018-08-16 20:20:47 +0200
committer	Armin Le Grand <Armin.Le.Grand@cib.de>	2018-08-17 21:27:40 +0200
commit	046df0a876b3d948bb1e14443c00c180bc8cccaa (patch)
tree	9619fa49b3f1b66302cbae973603f1c3f41ba3b0
parent	bc28d51cb88c796da241d1ab914bbe6bb174cc49 (diff)
tdf#105998: Enhanced fix for MetafileToBitmap at better place