Bug 168886 - FILESAVE EMF Pat of OriginPro image (EMF+ records) scaled to different size during save
Summary: FILESAVE EMF Pat of OriginPro image (EMF+ records) scaled to different size d...
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
26.2.0.0 alpha0+ master
Hardware: All All
: medium normal
Assignee: Bartosz
URL:
Whiteboard: target:26.8.0 target:26.2.3
Keywords:
Depends on: 168884
Blocks: EMF-WMF
  Show dependency treegraph
 
Reported: 2025-10-16 10:17 UTC by Piotr Osada
Modified: 2026-04-07 06:30 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Image comparison (64.85 KB, application/pdf)
2025-10-16 10:32 UTC, Piotr Osada
Details
'Original good image' (extracted from MS Word saved *.docx.zip) (31.55 KB, image/x-emf)
2025-10-16 13:29 UTC, Piotr Osada
Details
After looking inside problematic EMF, there is EMF object inside EMF file (190.08 KB, image/png)
2026-02-15 20:26 UTC, Bartosz
Details
Steps to reproduce (3.55 MB, video/mp4)
2026-02-16 22:30 UTC, Piotr Osada
Details
Broken image → cropped chart (1.06 MB, video/mp4)
2026-02-16 22:40 UTC, Piotr Osada
Details
Word correctly catches EMF (3.24 MB, video/mp4)
2026-02-16 22:42 UTC, Piotr Osada
Details
InsideClipboard: Origin EMF clipboard content (10.77 KB, application/x-compressed)
2026-02-16 22:52 UTC, Piotr Osada
Details
2026-03-06 patch: image shrinks and shifts - paste broken, reload unfixed (12.51 MB, video/mp4)
2026-03-08 14:04 UTC, Piotr Osada
Details
EMF file which is causing import issue (31.55 KB, image/emf)
2026-03-10 06:23 UTC, Bartosz
Details
DOCX saved by MSO Writer (19.27 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2026-03-10 15:07 UTC, Piotr Osada
Details
LO26.2.1.2 behavior before regression on 2026-03-06 (9.23 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2026-03-10 15:08 UTC, Piotr Osada
Details
LOdev20260308 behavior (regressed) (9.51 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2026-03-10 15:18 UTC, Piotr Osada
Details
Affected Origin copy-paste: 26.2.1.2 (8.15 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2026-03-10 16:51 UTC, Piotr Osada
Details
Affected Origin copy-paste: 26.8dev 20260308 (8.75 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2026-03-10 16:53 UTC, Piotr Osada
Details
Affected Origin copy-paste: Word (2026-02) (19.24 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2026-03-10 17:00 UTC, Piotr Osada
Details
Extracted bad, final EMF image created by LO (15.95 KB, image/emf)
2026-03-13 15:35 UTC, Bartosz
Details
Extracted good, final EMF image created by Word (31.55 KB, image/emf)
2026-03-13 15:36 UTC, Bartosz
Details
Test of patch 201679 (still bug) (249.46 KB, application/vnd.oasis.opendocument.text)
2026-03-16 20:22 UTC, Piotr Osada
Details
Build containing 201679 data (4.46 KB, text/plain)
2026-03-16 20:25 UTC, Piotr Osada
Details
Copy Graph as Image → EMF (LO26.2.1.2 ODT) (624.91 KB, application/vnd.oasis.opendocument.text)
2026-03-23 16:22 UTC, Piotr Osada
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Osada 2025-10-16 10:17:47 UTC
+++ This bug was initially created as a clone of Bug #168884 +++

Steps:
1) Insert Example EMF from attachment 203351 [details] into LO (Writer, Impress, Calc).

Result:
The image is cropped.

Expected:
Pasted bar-chat-image should be in the same proportions as original view inserted directly from Origin software from the attachment 203355 [details] (tdf#168884_Bar_plot_with_Labels.opju).
 


Version: 25.8.2.2 (X86_64)
Build ID: d401f2107ccab8f924a8e2df40f573aab7605b6f
CPU threads: 16; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Raster; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: CL threaded

Version: 25.8.1.1 (X86_64)
Build ID: 54047653041915e595ad4e45cccea684809c77b5
CPU threads: 16; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Vulkan; VCL: win
Locale: pl-PL (pl_PL); UI: pl-PL
Calc: CL threaded

Version: 24.2.7.2 (X86_64) / LibreOffice Community
Build ID: ee3885777aa7032db5a9b65deec9457448a91162
CPU threads: 16; OS: Windows 10.0 Build 26100; UI render: Skia/Raster; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: CL threaded
Comment 1 Piotr Osada 2025-10-16 10:32:31 UTC
Created attachment 203360 [details]
Image comparison
Comment 2 Piotr Osada 2025-10-16 10:37:35 UTC
The same in:
Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: d60ff8c8bd4e3ebf8f84f53448ead3c838332ea9
CPU threads: 16; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Vulkan; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: CL threaded
Comment 3 Piotr Osada 2025-10-16 13:29:26 UTC
Created attachment 203371 [details]
'Original good image' (extracted from MS Word saved *.docx.zip)

While attachment 203351 [details]: Example EMF from the Bug 168884 
was made by (Writer):
1) Copy Graph as Image (in Origin Pro)
2) Paste into Writer
3) Save as DOCX
4) Extract from *.docx.zip

This was made by (MS Word):
1) Copy Graph as Image (in Origin Pro)
2) Paste into MS Word
3) Save as DOCX
4) Extract from *.docx.zip

As a result, there is about twice as much EMR records in MS Word saved EMF-image. Compared by:
1) EMFParser
https://download.cnet.com/emf-parser/3000-2383_4-10558240.html

2) WinMerge
https://winmerge.org/
Comment 4 Piotr Osada 2025-10-16 13:30:54 UTC
'Original good image' (attachment 203371 [details]) displays correctly - uncropped.
Comment 5 WillieHawkins 2025-10-23 07:30:28 UTC
+++ This report was originally cloned from Bug #168884 +++

Steps to reproduce:

Insert the sample EMF file from attachment 203351 [details] into LibreOffice (Writer, Impress, or Calc).

Actual result:
The inserted image appears cropped.

Expected result:
The bar chart image should maintain the same proportions as the original version shown when inserted directly from the source software (attachment 203355 [details]tdf#168884_Bar_plot_with_Labels.opju).

Tested versions:

Version: 25.8.2.2 (x86_64)
Build ID: d401f2107ccab8f924a8e2df40f573aab7605b6f
CPU threads: 16; OS: Windows 11 (build 26100); UI render: Skia/Raster; VCL: win
Locale: pl-PL; UI: en-US; Calc: CL threaded

Version: 25.8.1.1 (x86_64)
Build ID: 54047653041915e595ad4e45cccea684809c77b5
CPU threads: 16; OS: Windows 11 (build 26100); UI render: Skia/Vulkan; VCL: win
Locale: pl-PL; UI: pl-PL; Calc: CL threaded
https://download.cnet.com/emf-parser/3000-2383_4-10558240.html https://geometrydash-3d.io

Version: 24.2.7.2 (x86_64) / LibreOffice Community
Build ID: ee3885777aa7032db5a9b65deec9457448a91162
CPU threads: 16; OS: Windows 10 (build 26100); UI render: Skia/Raster; VCL: win
Locale: pl-PL; UI: en-US; Calc: CL threaded
Comment 6 Piotr Osada 2025-10-23 15:02:56 UTC
(In reply to WillieHawkins from comment #5)

Willie, have you tested this behavior? What was your configuration?
I suppose not the same as me :-)
Comment 7 Bartosz 2026-02-15 20:26:15 UTC
Created attachment 205537 [details]
After looking inside problematic EMF, there is EMF object inside EMF file

Good image (image1_tdf#168884_MS_Word.emf) which is working correctly, contains drawing records.

Corrupted image (Bar_chart_with_Label_on_bar_25.8.2.2.emf), contain EMF object inside EMF file
Comment 8 Bartosz 2026-02-15 20:57:34 UTC
I have tried to reproduce this issue with MS Office, and the result (image too big and cropped), is the same as with LibreOffice.

Please clarify how to reproduce the issue.
Comment 9 Piotr Osada 2026-02-16 22:30:50 UTC
Created attachment 205564 [details]
Steps to reproduce

Steps to reproduce:
1) Copy-paste from the Origin file (attachment 203355 [details]) as EMF
2) Save as docx
3) Reopen file

Result: Cropped image.


Expected: Same as in OriginPro window.
Comment 10 Piotr Osada 2026-02-16 22:40:26 UTC
Created attachment 205565 [details]
Broken image → cropped chart

Inserting a broken image results in a cropped chart.
"Broken image → broken result".
Comment 11 Piotr Osada 2026-02-16 22:42:12 UTC
Created attachment 205566 [details]
Word correctly catches EMF
Comment 12 Piotr Osada 2026-02-16 22:52:04 UTC
Created attachment 205567 [details]
InsideClipboard: Origin EMF clipboard content

InsideClipboard v1.30 gathered data:

==================================================
Format ID         : 3
Format Name       : CF_METAFILEPICT
Handle Type       : Metafile 
Size              : 0
Index             : 2
==================================================

==================================================
Format ID         : 14
Format Name       : CF_ENHMETAFILE
Handle Type       : Enhanced metafile
Size              : 0
Index             : 1
==================================================
Comment 13 QA Administrators 2026-02-17 03:13:09 UTC Comment hidden (obsolete)
Comment 14 Bartosz 2026-03-07 18:22:16 UTC Comment hidden (obsolete)
Comment 15 Piotr Osada 2026-03-08 14:04:32 UTC Comment hidden (obsolete)
Comment 16 Bartosz 2026-03-10 06:23:17 UTC Comment hidden (obsolete)
Comment 17 Piotr Osada 2026-03-10 15:07:28 UTC Comment hidden (obsolete)
Comment 18 Piotr Osada 2026-03-10 15:08:26 UTC Comment hidden (obsolete)
Comment 19 Piotr Osada 2026-03-10 15:18:49 UTC Comment hidden (obsolete)
Comment 20 Piotr Osada 2026-03-10 16:51:45 UTC Comment hidden (obsolete)
Comment 21 Piotr Osada 2026-03-10 16:53:24 UTC Comment hidden (obsolete)
Comment 22 Piotr Osada 2026-03-10 17:00:53 UTC Comment hidden (obsolete)
Comment 23 Commit Notification 2026-03-13 10:45:07 UTC
Bartosz Kosiorek committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/c1fb4c337da358fe221e7e0ec172ec53742c4ba8

tdf59814 tdf168886 EMF+ Use Frame size and DPI instead Bound

It will be available in 26.8.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 24 Bartosz 2026-03-13 15:35:19 UTC
Created attachment 206145 [details]
Extracted bad, final EMF image created by LO
Comment 25 Bartosz 2026-03-13 15:36:04 UTC
Created attachment 206146 [details]
Extracted good, final EMF image created by Word
Comment 26 Bartosz 2026-03-13 22:14:28 UTC Comment hidden (obsolete)
Comment 27 Piotr Osada 2026-03-13 22:29:56 UTC Comment hidden (obsolete)
Comment 28 Bartosz 2026-03-14 09:01:24 UTC Comment hidden (obsolete)
Comment 29 Commit Notification 2026-03-14 09:06:00 UTC
Bartosz Kosiorek committed a patch related to this issue.
It has been pushed to "libreoffice-26-2":

https://git.libreoffice.org/core/commit/5c3bf1387bce8f899e0b3b5f5aaef827931763e9

tdf59814 tdf168886 EMF+ Use Frame size and DPI instead Bound

It will be available in 26.2.3.

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 30 Piotr Osada 2026-03-16 20:22:45 UTC
Created attachment 206210 [details]
Test of patch 201679 (still bug)

(In reply to Bartosz from comment #26)
> I have create patch proposal:
> https://gerrit.libreoffice.org/c/core/+/201679
> 
> It would need to be verified with Copy-Paste

Bug still exists. Transformation of EMF at paste looks similar as previously.

Version: 26.8.0.0.alpha0+ (X86_64)
Build ID: a84598a2476ef7b66c6f7ce0328a700c81894f28
CPU threads: 16; OS: Windows 11 X86_64 (build 26200); UI render: Skia/Vulkan; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: CL threaded
Comment 31 Piotr Osada 2026-03-16 20:25:54 UTC
Created attachment 206211 [details]
Build containing 201679 data

(In reply to Piotr Osada from comment #30)
> Created attachment 206210 [details]

Does this report confirm that the build I used included Your patch?

Version: 26.8.0.0.alpha0+ (X86_64)
Build ID: a84598a2476ef7b66c6f7ce0328a700c81894f28
CPU threads: 16; OS: Windows 11 X86_64 (build 26200); UI render: Skia/Vulkan; VCL: win
Locale: pl-PL (pl_PL); UI: en-US
Calc: CL threaded
Comment 32 Bartosz 2026-03-22 18:20:32 UTC
Please provide Copy & Paste image into LibreOffice and save it in ODT format.
From there it will be possible to reproduce resave.
Comment 33 Piotr Osada 2026-03-23 16:22:52 UTC
Created attachment 206370 [details]
Copy Graph as Image → EMF (LO26.2.1.2 ODT)

Saved as ODT by:
Version: 26.2.1.2 (X86_64)
Build ID: 620(Build:2)
CPU threads: 8; OS: Windows 11 X86_64 (build 26200); UI render: Skia/Raster; VCL: win
Locale: en-US (pl_PL); UI: en-US
Calc: CL threaded


Steps:
1) Open ‘tdf#168884_Bar_plot_with_Labels.opju’
(https://bugs.documentfoundation.org/attachment.cgi?id=203355)
2) In Origin: Select the Graph1 window → Right-click on the window title bar
3) Copy Graph as Image → EMF
4) In Writer: Paste (Ctrl+V)
5) Save as ODT.
Comment 34 Commit Notification 2026-03-24 14:44:39 UTC
Bartosz Kosiorek committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/b84b64a8e1faea9d781834a23c5dbe9572eca6f5

tdf168886 EMF FILESAVE: Fix precision of DPI calculation in EMF+ header

It will be available in 26.8.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 35 Commit Notification 2026-03-28 08:29:21 UTC
Bartosz Kosiorek committed a patch related to this issue.
It has been pushed to "libreoffice-26-2":

https://git.libreoffice.org/core/commit/d5a8cef2b6d19a09a5071fac02f2b71904ed2a31

tdf168886 EMF FILESAVE: Fix precision of DPI calculation in EMF+ header

It will be available in 26.2.3.

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 36 Piotr Osada 2026-03-30 23:04:58 UTC
This should fix scaling issue:
https://gerrit.libreoffice.org/c/core/+/202536/4
Comment 37 Commit Notification 2026-04-01 22:49:11 UTC
Piotr Osada committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/2b97b8008b8bebffb1d4a2732266e19ee51c88c6

tdf#168886 tdf#168237 vcl: Preserve EMF GfxLink on clipboard paste

It will be available in 26.8.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 38 Commit Notification 2026-04-01 22:52:16 UTC
Piotr Osada committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/aca4a0c073c5e5f93c642b68f9afd07e65dbf302

tdf#168886 tdf#168237 oox: Detect EMF in NativeWmf GfxLink

It will be available in 26.8.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 39 Bartosz 2026-04-02 11:21:05 UTC
With:
https://git.libreoffice.org/core/+/2b97b8008b8bebffb1d4a2732266e19ee51c88c6%5E%21

it is exporting from ODT to DOCX perfectly fine.
Comment 40 Piotr Osada 2026-04-07 06:30:04 UTC
OrignPro: Copy Graph as Image... -> EMF -->
--> Paste in Writer -> save as DOCX now works, and graph geometry is as expected.

Verified in:
Version: 26.8.0.0.alpha0+ (X86_64)
Build ID: eb4c2bf13774d3232a445a9313298dbe0013c26e
CPU threads: 16; OS: Windows 11 X86_64 (build 26200); UI render: Skia/Raster; VCL: win
Locale: pl-PL (pl_PL); UI: pl-PL
Calc: threaded