Bug 122557

Summary: FILEOPEN: EMF+: DrawImage record is not rotating images properly
Product: LibreOffice Reporter: Bartosz <gang65>
Component: DrawAssignee: Bartosz <gang65>
Status: RESOLVED FIXED    
Severity: normal CC: gang65, vsfoote
Priority: medium Keywords: filter:emf
Version: Inherited From OOo   
Hardware: All   
OS: All   
Whiteboard: target:6.3.0
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 103859    
Attachments: EMF+ which is wrongly displayed under Writer/Draw
EMF+ Image using DrawImage, rotated by 30 degrees
EMF+ Rotated image with DrawImagePoints without Shearing

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.