Bug Hunting Session
Bug 122557 - FILEOPEN: EMF+: DrawImage record is not rotating images properly
Summary: FILEOPEN: EMF+: DrawImage record is not rotating images properly
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Bartosz
URL:
Whiteboard: target:6.3.0
Keywords: filter:emf
Depends on:
Blocks: EMF-WMF
  Show dependency treegraph
 
Reported: 2019-01-07 23:19 UTC by Bartosz
Modified: 2019-01-17 16:15 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
EMF+ which is wrongly displayed under Writer/Draw (763.19 KB, image/emf)
2019-01-07 23:20 UTC, Bartosz
Details
EMF+ Image using DrawImage, rotated by 30 degrees (755.24 KB, image/emf)
2019-01-16 21:33 UTC, Bartosz
Details
EMF+ Rotated image with DrawImagePoints without Shearing (741.17 KB, image/emf)
2019-01-16 23:09 UTC, Bartosz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bartosz 2019-01-07 23:19:35 UTC
Description:
 DrawImage record is not rotating images properly

Steps to Reproduce:
1. Drag and drop attached EMF+ file to Writer
2. Compare attached image with file displayed by MS Word


Actual Results:
The image is not rotated (only scaled)

Expected Results:
The image is properly rotated and scaled.


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Bartosz 2019-01-07 23:20:12 UTC
Created attachment 148120 [details]
EMF+ which is wrongly displayed under Writer/Draw
Comment 2 V Stuart Foote 2019-01-07 23:33:38 UTC
@Bartosz, could you check that attached EMF? It looks distorted (skewed) inserted to Word, or opened with IrfanView, or Paint. 

But opens up without rotation/skew in Draw or inserted to Writer, but a bit under size as if needing to scale.

Is the sample EMF *supposed* to be skewed/rotated and look distorted, and that is the issue?
Comment 3 Bartosz 2019-01-08 10:59:59 UTC
Yes. The image should be distorted.
I generated this EMF+ file from the source code available at:
https://docs.microsoft.com/en-us/windows/desktop/api/gdiplusgraphics/nf-gdiplusgraphics-graphics-drawimage(inimage_inconstpointf_inint)
Comment 4 Bartosz 2019-01-08 11:01:37 UTC Comment hidden (obsolete)
Comment 6 Bartosz 2019-01-16 21:33:50 UTC
Created attachment 148378 [details]
EMF+ Image using DrawImage, rotated by 30 degrees
Comment 7 Bartosz 2019-01-16 23:09:37 UTC
Created attachment 148381 [details]
EMF+ Rotated image with DrawImagePoints without Shearing
Comment 8 Commit Notification 2019-01-17 06:55:57 UTC
Bartosz Kosiorek committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/e3ccc09417731e61d3d35ed4cc1a7436e05f5325%5E%21

tdf#122557 EMF+ Implement proper rotation support of DrawImage

It will be available in 6.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2019-01-17 16:10:13 UTC
Bartosz Kosiorek committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/3bd7f23e1ad74014584ffecb77434ddd5a068d82%5E%21

tdf#122557 EMF+ Implement Shearing for DrawImage records

It will be available in 6.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.