Bug 53004 - [WMF] FILEOPEN Black squares is missing after import WMF file created by LTspice
Summary: [WMF] FILEOPEN Black squares is missing after import WMF file created by LTspice
Status: CLOSED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: x86 (IA32) All
: medium normal
Assignee: Bartosz
URL:
Whiteboard: target:7.2.0
Keywords:
Depends on:
Blocks: EMF-WMF
  Show dependency treegraph
 
Reported: 2012-07-31 13:46 UTC by frank
Modified: 2024-05-03 09:33 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
An exported WMF file from LTspice (4.99 KB, image/x-wmf)
2012-07-31 13:46 UTC, frank
Details
Astable.WMF How it should appears (20.73 KB, image/png)
2012-07-31 14:26 UTC, frank
Details
Astable image from LTspice IV (237.25 KB, image/png)
2013-06-27 19:43 UTC, Jacques Guilleron
Details
WMF file opened in GIMP 2.8.10 (88.79 KB, image/png)
2014-11-13 23:35 UTC, Robinson Tryon (qubit)
Details
Reduced WMF sample with only squares (276 bytes, image/x-wmf)
2021-05-23 11:29 UTC, Valek Filippov
Details
Screenshot for reduced sample (3.62 KB, image/png)
2021-05-23 11:30 UTC, Valek Filippov
Details
WMF sample with ETO_OPAQUE and SetBKMode=1 (244 bytes, image/x-wmf)
2021-05-29 18:16 UTC, Valek Filippov
Details
How ETO_OPAQUE and SetBKMode=1 should look like (3.42 KB, image/png)
2021-05-29 18:17 UTC, Valek Filippov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description frank 2012-07-31 13:46:16 UTC
Created attachment 64991 [details]
An exported WMF file from LTspice

WMF files exported from LTspice aren't correctly displayed in Writer (electrical junctions of schematics are not visible what ever colour you choose).

IrfanView opens and display the image correctly;
Winxp built in image viewer too.

Steps to reproduce bug:

1) Download free LTspice and install it : http://www.linear.com/designtools/software/

2) Open any file in .\Educational folder

3) Make: Tools -> Write to wmf file
Comment 1 frank 2012-07-31 14:26:19 UTC
Created attachment 64993 [details]
Astable.WMF How it should appears
Comment 2 A (Andy) 2013-02-16 15:12:31 UTC Comment hidden (obsolete)
Comment 3 bfoman (inactive) 2013-03-06 14:04:40 UTC
Confirmed with:
LO 4.0.1.2
Build ID: own W7 debug build
Windows 7 Professional SP1 64 bit

Electrical junctions of schematics are not visible.
Comment 4 bfoman (inactive) 2013-03-06 14:16:22 UTC
(In reply to comment #0)
> (electrical junctions of schematics are not visible what ever colour you
> choose).

(In reply to comment #3)
> Electrical junctions of schematics are not visible.

Checked this in Gimp 2.6.12 and black squares on junctions are not visible (same as in LibreOffice). Otherwise it looks pretty much the same.

@reporter:
Does your screenshot come from LTspice itself or is it a file exported by it?
Comment 5 frank 2013-03-06 15:41:44 UTC Comment hidden (obsolete)
Comment 6 frank 2013-03-06 15:42:29 UTC
Electrical junctions of schematics are still not visible.

Versions
---------------------
LibreOffice: 4.0.1.2 (Build ID: 84102822e3d61eb989ddd325abf1ac077904985)
LTspice:     4.18d
OS:          Win7 Pro 64bit SP1

Steps to reproduce the bug:

- Open a LTspice file (I used: .\Examples\Educational\1563.ASC)
- Select Tools > Write to a .wmf file
- Save the .wmf file where you want (I saved in: .\Desktop)
- Open LO Writer: Insert > Image from File ...
Comment 7 Jacques Guilleron 2013-06-27 15:07:52 UTC Comment hidden (obsolete)
Comment 8 frank 2013-06-27 17:43:06 UTC
Anyway, still not working
LTspice 4.19h
LO 4.0.3.3
Windows 7 Professional 64bit SP1




2013/6/27 <bugzilla-daemon@freedesktop.org>

>  Jacques Guilleron <guilleron29@aol.com> changed bug 53004<https://bugs.freedesktop.org/show_bug.cgi?id=53004>
>  What Removed Added  Status UNCONFIRMED RESOLVED  Resolution --- WORKSFORME
>  CC   guilleron29@aol.com  See Also
> https://bugs.freedesktop.org/show_bug.cgi?id=65765
>
>  *Comment # 7 <https://bugs.freedesktop.org/show_bug.cgi?id=53004#c7> on bug
> 53004 <https://bugs.freedesktop.org/show_bug.cgi?id=53004> from Jacques
> Guilleron <guilleron29@aol.com> *
>
> Hello Frank,
>
> Just Copy Bitmap to Clipboard in LTspice Tools and paste it into Writer. This
> work for me with LO 4.2.0.0.alpha0+
> Build ID: ce0383d2950d3b0da2c457c8a406c1229de53571
> and LO 3.6.6.2 Portable
> Windows 7 Home Premium
>
> Have a nice day,
>
> Jacques
>
>  ------------------------------
> You are receiving this mail because:
>
>    - You reported the bug.
>
>
Comment 9 Jacques Guilleron 2013-06-27 19:43:38 UTC
Created attachment 81579 [details]
Astable image from LTspice IV
Comment 10 Jacques Guilleron 2013-06-27 20:05:23 UTC Comment hidden (obsolete)
Comment 11 frank 2013-06-28 06:12:44 UTC Comment hidden (obsolete)
Comment 12 Jacques Guilleron 2013-06-29 11:02:23 UTC Comment hidden (obsolete)
Comment 13 Joel Madero 2014-11-06 17:27:08 UTC Comment hidden (obsolete)
Comment 14 Robinson Tryon (qubit) 2014-11-13 23:35:32 UTC
Created attachment 109442 [details]
WMF file opened in GIMP 2.8.10
Comment 15 Robinson Tryon (qubit) 2014-11-13 23:50:19 UTC
(In reply to Jacques Guilleron from comment #12)
> Hi Frank,
> 
> Since transparency and colors are missing in the imported .wmf, I reopen
> this report.

I compared attachment 64993 [details] and attachment 81579 [details], and they look pretty darn similar.

Opening the WMF file in GIMP 2.8.10 (see attachment 109442 [details]), the black squares on the line junctions are missing, and the layout of text is a bit off (probably due to font replacement).

Opening the WMF file in LO 4.4.0.0.alpha2 (on Ubuntu 14.04), the text layout looks much better than the GIMP. Black squares are still missing.


Status -> NEW
Comment 16 QA Administrators 2015-12-20 16:18:08 UTC Comment hidden (obsolete)
Comment 17 Bartosz 2017-04-24 11:34:29 UTC Comment hidden (obsolete)
Comment 18 QA Administrators 2018-06-20 02:49:17 UTC Comment hidden (obsolete)
Comment 19 Timur 2019-04-30 14:46:41 UTC Comment hidden (obsolete)
Comment 20 QA Administrators 2021-04-30 04:01:42 UTC Comment hidden (obsolete)
Comment 21 Timur 2021-04-30 10:31:29 UTC
Repro 7.2+. Steps are: open LO and insert WMF attachment 64991 [details].

The other day I saw the same issue, but can't find a bug now, it would be a duplicate.
Comment 22 Valek Filippov 2021-05-23 11:29:16 UTC
Created attachment 172266 [details]
Reduced WMF sample with only squares

Few colors were changed JFF.
Those squares are combination of ExtTextOut w/o text and SetBKColor.
Comment 23 Valek Filippov 2021-05-23 11:30:42 UTC
Created attachment 172267 [details]
Screenshot for reduced sample
Comment 24 Commit Notification 2021-05-28 19:48:30 UTC
Bartosz Kosiorek committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3a9027609e7ee0c7af457b06426093782ca295a8

tdf#53004 tdf#142495 WMF EMF Fix displaying Text with OPAQUE and CLIPPED

It will be available in 7.2.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 25 Valek Filippov 2021-05-29 18:16:05 UTC
Created attachment 172441 [details]
WMF sample with ETO_OPAQUE and SetBKMode=1

This one renders correctly with today's daily build of LO.
Attaching for completeness.
Comment 26 Valek Filippov 2021-05-29 18:17:54 UTC
Created attachment 172442 [details]
How ETO_OPAQUE and SetBKMode=1 should look like

SetBKMode=1 (Transparent) impacts the background of the text itself, but doesn't change how ETO_OPAQUE rectangle is rendered.
Comment 27 Commit Notification 2021-05-31 05:33:23 UTC
Bartosz Kosiorek committed a patch related to this issue.
It has been pushed to "master":

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

tdf#53004 tdf#142495 WMF EMF Always display Text rectangle

It will be available in 7.2.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 28 Timur 2021-05-31 08:07:02 UTC
Thanks Bartosz for this one and many others you fixed. 
Looking good, I set verified.