Bug 133297 - FILEOPEN: Images incorrectly scaled/cropped and text items misplaced in imported MS Publisher 2007 file in DRAW
Summary: FILEOPEN: Images incorrectly scaled/cropped and text items misplaced in impor...
Status: NEW
Alias: None
Product: Document Liberation Project
Classification: Unclassified
Component: libmspub (show other bugs)
(earliest affected)
Hardware: All All
: medium normal
Assignee: Not Assigned
Depends on:
Blocks: Draw-Images
  Show dependency treegraph
Reported: 2020-05-22 23:47 UTC by Andrea Giudiceandrea
Modified: 2022-12-27 22:10 UTC (History)
4 users (show)

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

TEST.pub (110.50 KB, application/x-ole-storage)
2020-05-22 23:51 UTC, Andrea Giudiceandrea
TEST_LO7DRAW.png (249.46 KB, image/png)
2020-05-22 23:53 UTC, Andrea Giudiceandrea
TEST_PUBLISHER.png (329.51 KB, image/png)
2020-05-22 23:55 UTC, Andrea Giudiceandrea
2020-05-22 23:56 UTC, Andrea Giudiceandrea

Note You need to log in before you can comment on or make changes to this bug.
Description Andrea Giudiceandrea 2020-05-22 23:47:45 UTC
Images in imported MS Publisher 2007 document are incorrectly scaled or cropped when visualized in DRAW.
Same text items are also slightly incorrectly positioned in the page.

Basically, images in the original Publisher file, are cropped and scaled.
When the original Publisher file is imported in DRAW, the images are only shrinked/squeezed/stretched to stay in the rectangular dimension.

For example, the first image at the top of the page, in the original Publisher document, has the following properties:
- position x: 2,6 cm
- position y: 2 cm
- height: 8,712 cm
- width: 8,824 cm
- scaling height: 50 %
- scaling width: 50 %
- left crop: 1,806 cm
- right crop: 1,639 cm
- top crop: 5,933 cm
- bottom crop: 6,433 cm

while the same image, when the Publisher document is imported in DRAW, has the following properties:
- position x: 2,60 cm
- position y: 1,99 cm
- height: 8,73 cm
- width: 8,83 cm

Steps to Reproduce:
1. Open attached TEST.pub with DRAW

Actual Results:
Images are incorrectly scaled and not cropped and some items are slightly incorrectly positioned (text items A a, B b, C c, D d)
Exported in PNG format from DRAW

Expected Results:
Images are correctly scaled and cropped and items are correctly positioned
Exported in PNG format from Microsoft Publisher

See also:
Difference between TEST_LO7DRAW (in red) and TEST_PUBLISHER (in blue)

Reproducible: Always

User Profile Reset: Yes

Additional Info:
Version: (x64)
Build ID: 9a7c5d38a7a43c75c0f3d2f0c725196e916d0260
Thread CPU: 4; SO: Windows 10.0 Build 18362; Resa interfaccia: Skia/Raster; VCL: win;
Comment 1 Andrea Giudiceandrea 2020-05-22 23:51:34 UTC
Created attachment 161173 [details]

Sample Publisher document
Comment 2 Andrea Giudiceandrea 2020-05-22 23:53:42 UTC
Created attachment 161174 [details]

Sample Publisher document exported in PNG format from DRAW
Comment 3 Andrea Giudiceandrea 2020-05-22 23:55:33 UTC
Created attachment 161175 [details]

Sample Publisher document exported in PNG format from Microsoft Publisher
Comment 4 Andrea Giudiceandrea 2020-05-22 23:56:49 UTC
Created attachment 161176 [details]

Difference between TEST_LO7DRAW (in red) and TEST_PUBLISHER (in blue)
Comment 5 Rainer Bielefeld Retired 2020-08-01 17:41:57 UTC
REPRODUCIBLE with Version: (x64)
CPU-Threads: 4; BS: Windows 6.1 Service Pack 1 Build 7601; UI-Render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: CL
Colibre theme

The report contains multiple issues with probably different roots, so I recommend to split this one into separate Bugs for each problem ("File a separate bug report for each bug you run into ...")

My observations:

a) There is some progress compared to LibO 6.4, which only shows white rectangels instead of pictures
b) The height/width ratio issue is - at least partially - related to the slide property "Margin" in the Slide Panel in the Sidebar. Modifications there will distort the graphics in the page. This problem is already visible in LibO 6.4 and is a general problem, is not a particular .pub import problem. Probably DUP of "Bug 121491 - Objects silently resized when changing margins by sidebar"
c) The wrong picture contents might be related to ignoring cropping and several other effects, that IS a particular import problem.
d) "Misplaced Text Items" is a very little problem compared to the other ones, and  probably with different roots to(b), (c).
e) So "CONFIRMED". bug not NEW due to concerns because of multiple issues in 1 report. Needs to be separated into different reports because different fixes will be required to heal the problems.
Comment 6 Xisco Faulí 2020-08-04 12:45:35 UTC
Reproduced in

Build ID: 58937aa4a50ecd681382f03331340da4c843b01e
CPU threads: 4; OS: Linux 4.19; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Build ID: 5b168b3fa568e48e795234dc5fa454bf24c9805e
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; 
Locale: ca-ES (ca_ES.UTF-8)

Version (Build ID: efca6f15609322f62a35619619a6d5fe5c9bd5a)
Comment 7 Andrea Giudiceandrea 2022-01-21 22:34:31 UTC
Are there any other news about this bug?
Comment 8 BogdanB 2022-12-27 22:10:06 UTC
Also in
Version: / LibreOffice Community
Build ID: a09c5c69e3b5fbf448cae1d6c476f39067e40023
CPU threads: 4; OS: Linux 5.19; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded