Bug 138386 - WMF: LO Writer does not display .emf files properly
Summary: WMF: LO Writer does not display .emf files properly
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.0.3.1 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: EMF-WMF
  Show dependency treegraph
 
Reported: 2020-11-21 02:36 UTC by TorrAB
Modified: 2021-04-21 17:05 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
file with 2 figures (109.84 KB, application/vnd.oasis.opendocument.text)
2020-11-21 02:39 UTC, TorrAB
Details
showing one bad image (51.81 KB, image/png)
2020-11-21 02:42 UTC, TorrAB
Details
good rendering of .emf file, by IrfanView (31.33 KB, image/png)
2020-11-21 02:44 UTC, TorrAB
Details
file with figure (56.01 KB, application/vnd.oasis.opendocument.text)
2020-11-21 02:46 UTC, TorrAB
Details
…rendered by LO (56.02 KB, image/png)
2020-11-21 02:49 UTC, TorrAB
Details
…rendered by OO (38.39 KB, image/png)
2020-11-21 02:50 UTC, TorrAB
Details
Screenshot with 7.0.2 on Windows 10 (73.59 KB, image/png)
2020-11-21 20:02 UTC, Ming Hua
Details
The problematic WMF file extracted from file (109.02 KB, image/x-wmf)
2020-11-23 09:46 UTC, Bartosz
Details
Screenshot from LO 7.2.0 master which shows correct displaying (206.93 KB, image/png)
2021-03-24 13:59 UTC, Bartosz
Details
screenshot of ODT file with emf image (36.59 KB, image/png)
2021-04-14 02:44 UTC, TorrAB
Details
screenshot of PDF version of ODT file with emf image (27.75 KB, image/png)
2021-04-14 02:46 UTC, TorrAB
Details
file with EMF image (47.50 KB, application/vnd.oasis.opendocument.text)
2021-04-15 00:45 UTC, TorrAB
Details
emf file to show in Writer (Fig·36) (41.25 KB, image/x-emf)
2021-04-15 00:48 UTC, TorrAB
Details
file with EMF image; replaces attachment 171208 sent in error (47.63 KB, application/vnd.oasis.opendocument.text)
2021-04-15 19:47 UTC, TorrAB
Details
file with EMF image (50.18 KB, application/vnd.oasis.opendocument.text)
2021-04-15 21:46 UTC, TorrAB
Details
screenshot showing good&bad renderings side-by-side (70.83 KB, image/png)
2021-04-15 21:48 UTC, TorrAB
Details
The EMF pulled from attachment 171227 and added to Writer canvas (53.68 KB, image/png)
2021-04-15 22:03 UTC, V Stuart Foote
Details
image to insert in any .odt file (41.25 KB, image/x-emf)
2021-04-19 02:54 UTC, TorrAB
Details
attachment 171274 as inserted to Writer canvas LO 7.2.0 master (228.80 KB, image/png)
2021-04-19 03:00 UTC, V Stuart Foote
Details
screenshot of D3Cos.emf; compare to 171275 (205.63 KB, image/png)
2021-04-20 02:19 UTC, TorrAB
Details

Note You need to log in before you can comment on or make changes to this bug.
Description TorrAB 2020-11-21 02:36:35 UTC
Description:
**File GooBadFgs has 2 Figures, each containing a Graphics.
	Fig·2, copied from an OpenOffice document by copy&paste, looks good.
	Fig·10 looks bad. It was obtained by reading (Insert>Image) YE2SinY60.emf, which looks good when displayed separately by IrfanView —attached. Why?
**OpenOffice displays Fig·0c in File EaRCR.odt much better than LO —EaRCRLO.png, EaRCROO.png,attached.


Actual Results:
emf image is bad

Expected Results:
good image


Reproducible: Always


User Profile Reset: No



Additional Info:
none
Comment 1 TorrAB 2020-11-21 02:39:28 UTC
Created attachment 167440 [details]
file with 2 figures
Comment 2 TorrAB 2020-11-21 02:42:05 UTC
Created attachment 167441 [details]
showing one bad image
Comment 3 TorrAB 2020-11-21 02:44:29 UTC
Created attachment 167442 [details]
good rendering of .emf file, by IrfanView
Comment 4 TorrAB 2020-11-21 02:46:45 UTC
Created attachment 167443 [details]
file with figure
Comment 5 TorrAB 2020-11-21 02:49:32 UTC
Created attachment 167444 [details]
…rendered by LO
Comment 6 TorrAB 2020-11-21 02:50:36 UTC
Created attachment 167445 [details]
…rendered by OO
Comment 7 Ming Hua 2020-11-21 20:02:55 UTC
Created attachment 167455 [details]
Screenshot with 7.0.2 on Windows 10

First sample file looks different but still less than ideal for me with 7.0.2 on Windows 10.  Screenshot attached.  Not sure if this counts as reproduced or not...

Version: 7.0.2.2 (x64)
Build ID: 8349ace3c3162073abd90d81fd06dcfb6b36b994
CPU threads: 2; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win
Locale: zh-CN (zh_CN); 界面: zh-CN
Calc: threaded

When opened with 7.1.0 alpha1+ there are other problems.  Will investigate further.
Comment 8 Julien Nabet 2020-11-22 10:46:55 UTC
On pc Debian x86-64 with master sources updated today, on gtk3: I'm a bit stuck because of infinite loop of 
warn:vcl.gdi:30796:30796:vcl/headless/svpgdi.cxx:133: unsupported SvpSalGraphics::blendAlphaBitmap case
However, I noticed these on console logs:
warn:emfio:30796:30796:emfio/source/reader/emfreader.cxx:2025: not implemented 'AlphaDibBlend'
warn:emfio:30796:30796:emfio/source/reader/emfreader.cxx:2019: not implemented 'SetMetArgn'
warn:emfio:30796:30796:emfio/source/reader/emfreader.cxx:2018: not implemented 'SetBrushOrgEx'
warn:emfio:30796:30796:emfio/source/reader/emfreader.cxx:2020: not implemented 'SetMiterLimit'
warn:emfio:30796:30796:emfio/source/reader/emfreader.cxx:2025: not implemented 'AlphaDibBlend'
warn:emfio:30796:30796:emfio/source/reader/emfreader.cxx:1802: SJ: ETO_PDY || ETO_GLYPH_INDEX in EMF
warn:emfio:30796:30796:emfio/source/reader/emfreader.cxx:1802: SJ: ETO_PDY || ETO_GLYPH_INDEX in EMF

with gen rendering very slow and I noticed these on console:
warn:legacy.tools:30966:30966:vcl/unx/generic/gdi/salbmp.cxx:136: Unsupported BitCount!
warn:vcl.gdi:30966:30966:vcl/unx/generic/gdi/salbmp.cxx:163: 32-bit images not supported, converting to 24-bit
warn:vcl.layout:30966:30966:vcl/source/window/syswin.cxx:1094: SystemWindow has become non-layout because extra children have been added directly to it.
Comment 9 Julien Nabet 2020-11-22 10:55:50 UTC
Bartosz: noticing your work on EMF, thought you might be interested in this one.
Comment 10 Bartosz 2020-11-23 09:46:21 UTC
Created attachment 167498 [details]
The problematic WMF file extracted from file
Comment 11 Bartosz 2021-03-24 13:59:16 UTC
Created attachment 170697 [details]
Screenshot from LO 7.2.0 master which shows correct displaying

Unfortunately I cannot reproduce it on LO master:

Version: 7.2.0.0.alpha0+ / LibreOffice Community
Build ID: 8c24c6145f111dae7b83ac636043f20595559011
CPU threads: 12; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: CL
Comment 12 Timur 2021-04-13 09:17:49 UTC
This bug is not clearly reported, 2 different files and 2 images and just attachments dropped. Confusing. Please do not report like that. 
Both seem to be correct in LO 7.2+. If you don't think so, please be clear, like: open attachment 123 and se... Best to add single comparison screenshot. 

For report, I'd close this as WFM. 
Only issue I see here are warnings in Comment 8.
@Bartosz: please comment if these are a valid bug, to be implemented.
Comment 13 Bartosz 2021-04-13 09:58:09 UTC
It seems that the issue is not reproducible on master (LO 7.2).

Thanks.
Comment 14 TorrAB 2021-04-14 02:40:16 UTC
(In reply to Timur from comment #12)
> This bug is not clearly reported, 2 different files and 2 images and just
> attachments dropped. Confusing. Please do not report like that. 
> Both seem to be correct in LO 7.2+. If you don't think so, please be clear,
> like: open attachment 123 and se... Best to add single comparison
> screenshot. 
> 
> For report, I'd close this as WFM. 
> Only issue I see here are warnings in Comment 8.
> @Bartosz: please comment if these are a valid bug, to be implemented.

Just 2 screenshots, to avoid confusing you:
**Fig·36 from Writer Version: 7.2.0.0.alpha0+ (x64)
Build ID: f2171af6ce3516598d9f8bac8294025a21a5b1a2
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: en-CA (en_US); UI: en-US
Calc: threaded.---------------------- very bad; text hardly legible
**Fig·36pdf from PDF version of the same ODT file: very good!
Comment 15 TorrAB 2021-04-14 02:44:41 UTC
Created attachment 171174 [details]
screenshot of ODT file with emf image
Comment 16 TorrAB 2021-04-14 02:46:23 UTC
Created attachment 171175 [details]
screenshot of PDF version of ODT file with emf image
Comment 17 Timur 2021-04-14 06:16:09 UTC
I don't see value in previous comments. 
Apart that it's 2 instead of 1 comparison screenshot, again not clear where image Congress from. 
All this is very unclear.
Comment 18 TorrAB 2021-04-15 00:40:57 UTC
(In reply to Timur from comment #17)
> I don't see value in previous comments. 
> Apart that it's 2 instead of 1 comparison screenshot, again not clear where
> image Congress from. 
> All this is very unclear.

**‘very unclear’? Is it not clear that the image displayed by Writer is horrible, while the PDF display of the same image is very good?
 OK, I am sending the ODT file (D3Cos) and the EMF file so you can do your own tests. In particular, you could display the EMF file (eg, with irfanview) to see what it should look like if properly rendered.
https://www.irfanview.com/
Comment 19 TorrAB 2021-04-15 00:45:39 UTC
Created attachment 171208 [details]
file with EMF image

slightly different from previous sample
Comment 20 TorrAB 2021-04-15 00:48:46 UTC
Created attachment 171209 [details]
emf file to show in Writer (Fig·36)
Comment 21 Timur 2021-04-15 09:56:53 UTC
Attached EMF is different from the one in ODT... so it's normal they are different. EMF looks OK when put in ODT. o
This bug lost sense, please do not respond.
Comment 22 TorrAB 2021-04-15 19:47:07 UTC
Created attachment 171225 [details]
file with EMF image; replaces attachment 171208 [details] sent in error
Comment 23 TorrAB 2021-04-15 21:28:02 UTC
Sorry, I submitted D3Cos.odt before saving the document!
Here is the updated file (replacing attachments 171208 & 225), together with a screenshot showing good&bad renderings side-by-side.
Comment 24 TorrAB 2021-04-15 21:32:50 UTC
Sorry, I submitted D3Cos.odt before saving the document!
Here is the updated file (replacing attachments 171208 & 225), together with a screenshot showing good&bad renderings side-by-side.
Comment 25 TorrAB 2021-04-15 21:46:18 UTC
Created attachment 171227 [details]
file with EMF image

replaces attachments 171208 & 171225
Comment 26 TorrAB 2021-04-15 21:48:38 UTC
Created attachment 171228 [details]
screenshot showing good&bad renderings side-by-side
Comment 27 V Stuart Foote 2021-04-15 22:03:47 UTC
Created attachment 171229 [details]
The EMF pulled from attachment 171227 [details] and added to Writer canvas

This clip shows the EMF from the ODT archive extracted and inserted to the canvas.

Don't see an issue with rendering the EMF to canvas?
Comment 28 TorrAB 2021-04-19 02:48:12 UTC
(In reply to V Stuart Foote from comment #27)
> Created attachment 171229 [details]
> The EMF pulled from attachment 171227 [details] and added to Writer canvas
> 
> This clip shows the EMF from the ODT archive extracted and inserted to the
> canvas.
> 
> Don't see an issue with rendering the EMF to canvas?

I did not know you could ‘pull’ an EMF from an ODT file.
Could you try again using directly (Insert>Image>…) the EMF file, attached?
Comment 29 TorrAB 2021-04-19 02:54:23 UTC
Created attachment 171274 [details]
image to insert in any .odt file
Comment 30 V Stuart Foote 2021-04-19 03:00:26 UTC
Created attachment 171275 [details]
attachment 171274 [details] as inserted to Writer canvas LO 7.2.0 master

as requested... => WFM on 7.2.0 master (TB77 20210417)
Comment 31 V Stuart Foote 2021-04-19 03:03:00 UTC
(In reply to TorrAB from comment #29)
> Created attachment 171274 [details]
> image to insert in any .odt file

similar quality results with EMF Insert --> Image... dialog on Writer canvas with 7.1.2 or current 7.2.0 master as in clip.

Version: 7.1.2.2 (x64) / LibreOffice Community
Build ID: 8a45595d069ef5570103caea1b71cc9d82b2aae4
CPU threads: 4; OS: Windows 10.0 Build 19042; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: threaded
Comment 32 TorrAB 2021-04-20 02:19:56 UTC
Created attachment 171297 [details]
screenshot of D3Cos.emf; compare to 171275
Comment 33 Timur 2021-04-20 13:31:36 UTC
I close again, because Unconfirmed may attract QA and nothing to see here. 
Should Stuart follow and define a bug, ok. I don't follow anymore. 
Otherwise, do not change status. 
Torr, please appreciate others abd make clear abd concise reports, unlike this one.
Comment 34 V Stuart Foote 2021-04-20 16:24:42 UTC
(In reply to TorrAB from comment #32)
> Created attachment 171297 [details]
> screenshot of D3Cos.emf; compare to 171275

So, what Graphics card and driver are you working with?  Check by running msinfo32.exe from a command prompt, and look in the Components --> Display section for driver--just a clip of the panel from the top down to the Bits/Pixel row.

And, what happens if you disable the Skia rendering from Tools -> Options -> View and just use the CPU for default GDI rendering?

Does the EMF ( attachment 171274 [details] ) inserted to canvas render cleaner then?
Comment 35 TorrAB 2021-04-21 02:00:49 UTC
(In reply to V Stuart Foote from comment #34)
> (In reply to TorrAB from comment #32)
> > Created attachment 171297 [details]
> > screenshot of D3Cos.emf; compare to 171275
> 
> So, what Graphics card and driver are you working with?  Check by running
> msinfo32.exe from a command prompt, and look in the Components --> Display
> section for driver--just a clip of the panel from the top down to the
> Bits/Pixel row.
> 
> And, what happens if you disable the Skia rendering from Tools -> Options ->
> View and just use the CPU for default GDI rendering?
> 
> Does the EMF ( attachment 171274 [details] ) inserted to canvas render
> cleaner then?

**YES! Thank you! Skia was the problem, whatever that is…
Incidentally, msinfo32 tells me: Bits/Pixel:	32. Is this good?
Comment 36 V Stuart Foote 2021-04-21 13:54:57 UTC
(In reply to TorrAB from comment #35)
> > 
> > So, what Graphics card and driver are you working with?  Check by running
> > msinfo32.exe from a command prompt, and look in the Components --> Display
> > section for driver--just a clip of the panel from the top down to the
> > Bits/Pixel row.
> ...
> 
> **YES! Thank you! Skia was the problem, whatever that is…
> Incidentally, msinfo32 tells me: Bits/Pixel:	32. Is this good?

Bits/Pixel: 32 is fine, we need the details from the top of the panel to there.

Skia is the graphics library that alternatively handles LibreOffice's rendering to system display. It is the default for LO's Windows builds now, and will work with GPUs that support the Vulkan accelerated rendering--the two Skia "modes" on the Tools -> Options -> View panel

For older GPU hardware and CPUs with integrated GPUs, the older drivers for the graphics can cause issues.

Since LO's Skia rendering is not working correctly on your system (default GDI based rendering is), we need to know what you're working with.
Comment 37 Julien Nabet 2021-04-21 15:01:21 UTC
In addition to what V Stuart Foote indicated, you may take a look at https://wiki.documentfoundation.org/QA/FirstSteps#Graphics-related_issues_.28Skia.29
Comment 38 TorrAB 2021-04-21 17:05:53 UTC
(In reply to V Stuart Foote from comment #36)
> (In reply to TorrAB from comment #35)
> > > 
> > > So, what Graphics card and driver are you working with?  Check by running
> > > msinfo32.exe from a command prompt, and look in the Components --> Display
> > > section for driver--just a clip of the panel from the top down to the
> > > Bits/Pixel row.
> > ...
> > 
> > **YES! Thank you! Skia was the problem, whatever that is…
> > Incidentally, msinfo32 tells me: Bits/Pixel:	32. Is this good?
> 
> Bits/Pixel: 32 is fine, we need the details from the top of the panel to
> there.
> 
> Skia is the graphics library that alternatively handles LibreOffice's
> rendering to system display. It is the default for LO's Windows builds now,
> and will work with GPUs that support the Vulkan accelerated rendering--the
> two Skia "modes" on the Tools -> Options -> View panel
> 
> For older GPU hardware and CPUs with integrated GPUs, the older drivers for
> the graphics can cause issues.
> 
> Since LO's Skia rendering is not working correctly on your system (default
> GDI based rendering is), we need to know what you're working with.

Name	Intel(R) HD Graphics 620
PNP Device ID	PCI\VEN_8086&DEV_5916&SUBSYS_84A6103C&REV_02\3&11583659&2&10
Adapter Type	Intel(R) HD Graphics Family, Intel Corporation compatible
Adapter Description	Intel(R) HD Graphics 620
Adapter RAM	1.00 GB (1,073,741,824 bytes)
Installed Drivers	C:\WINDOWS\System32\DriverStore\FileRepository\igdlh64.inf_amd64_31f4e71363bfa9b6\igdumdim64.dll,C:\WINDOWS\System32\DriverStore\FileRepository\igdlh64.inf_amd64_31f4e71363bfa9b6\igd10iumd64.dll,C:\WINDOWS\System32\DriverStore\FileRepository\igdlh64.inf_amd64_31f4e71363bfa9b6\igd10iumd64.dll,C:\WINDOWS\System32\DriverStore\FileRepository\igdlh64.inf_amd64_31f4e71363bfa9b6\igd12umd64.dll
Driver Version	27.20.100.9171
Resolution	1366 x 768 x 60 hertz