[Libreoffice-bugs] [Bug 142941] [EMF+] DrawImagePoints and DrawImage SrcRect support

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Mon Sep 6 06:49:45 UTC 2021


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

--- Comment #16 from Bartosz <gang65 at poczta.onet.pl> ---
After fixes the EmfPlusRecordTypeDrawImage record with Bitmap embedded, is
displaying fine.

The EmfPlusRecordTypeDrawImage record with EMF MetaFile embedded is not
displaying correctly. The scale and width/heigh ratio is wrong. 
Here is the place where is the EmfPlusRecordTypeDrawImage implementation:
https://github.com/LibreOffice/core/blob/libreoffice-7-2/drawinglayer/source/tools/emfphelperdata.cxx#L1432


It seems that the EMF MetaFile was not displayed correctly due to an issue in
GDIMetaFile creation:

  GDIMetaFile aGDI(image.graphic.GetGDIMetaFile());


Source code:
https://github.com/LibreOffice/core/blob/libreoffice-7-2/drawinglayer/source/tools/emfphelperdata.cxx#L1559-L1566


The ratio (eg. where square becomes rectangle) could be corrected with:

  aSize = image.graphic.GetGDIMetaFile().GetPrefSize();
  double ratio = double(aSize.Width()) / double(aSize.Height()); // ratio 0.63

but unfortunately it doesn't fix the scale (the image could be too small or too
large).

I think the issue should be resolved in during invocation of
image.graphic.GetGDIMetaFile() method itself.

-- 
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/20210906/c71b6fef/attachment.htm>


More information about the Libreoffice-bugs mailing list