Converting WMF to PNG issues

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
pminfo01
Posts: 3
Joined: 2011-02-15T04:03:57-07:00
Authentication code: 8675308

Converting WMF to PNG issues

Post by pminfo01 »

Hello,
We use ImageMagick + GhostScript to convert WMF files to PNG, it works pretty well on almost every files but we have issues with some files.

When I run "convert.exe" in the command line, I get the following output :

Code: Select all

C:\>"C:\Program Files\ImageMagick-6.6.7-Q16\convert.exe" test2.wmf test2.png
Error: /undefined in -1.#IND00
Operand stack:
   --nostringval--   --nostringval--   1
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval-
-   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   fa
lse   1   %stopped_push   1910   1   3   %oparray_pop   1909   1   3   %oparray_
pop   --nostringval--   1893   1   3   %oparray_pop   1787   1   3   %oparray_po
p   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringv
al--   --nostringval--   2   %stopped_push   --nostringval--
Dictionary stack:
   --dict:1162/1684(ro)(G)--   --dict:0/20(G)--   --dict:82/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
Current file position is 49492
GPL Ghostscript  9.00: Unrecoverable error, exit code 1
Error: /undefined in -1.#IND00
Operand stack:
   --nostringval--   --nostringval--   1
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval-
-   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   fa
lse   1   %stopped_push   1910   1   3   %oparray_pop   1909   1   3   %oparray_
pop   --nostringval--   1893   1   3   %oparray_pop   1787   1   3   %oparray_po
p   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringv
al--   --nostringval--   2   %stopped_push   --nostringval--
Dictionary stack:
   --dict:1162/1684(ro)(G)--   --dict:0/20(G)--   --dict:82/200(L)--
Current allocation mode is local
Last OS error: No such file or directory
Current file position is 49492
GPL Ghostscript  9.00: Unrecoverable error, exit code 1
Magick: `%s': %s "C:/Program Files/gs/gs9.00/bin/gsdll32.dll" -q -dQUIET -dPARAN
OIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToP
ixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=
4 "-r72x72" -g482x976  "-sOutputFile=C:/Users/*********/AppData/Local/Temp/magick
-h0Vl7sCk-25105384" "-fC:/Users/*********/AppData/Local/Temp/magick-8UU-uege" "-f
C:/Users/*********/AppData/Local/Temp/magick-NYS8wlzj" @ error/ps.c/InvokePostscr
iptDelegate/190.
Magick: `%s': %s "C:/Program Files/gs/gs9.00/bin/gsdll32.dll" -q -dQUIET -dPARAN
OIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToP
ixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=
4 "-r72x72" -g482x976  "-sOutputFile=C:/Users/*********/AppData/Local/Temp/magick
-h0Vl7sCk-25105384" "-fC:/Users/*********/AppData/Local/Temp/magick-8UU-uege" "-f
C:/Users/*********/AppData/Local/Temp/magick-NYS8wlzj" -c showpage @ error/ps.c/I
nvokePostscriptDelegate/190.
Magick: Postscript delegate failed `C:/Users/*********/AppData/Local/Temp/magick-
Xnk6Wrq-': No such file or directory @ error/ps.c/ReadPSImage/812.
Magick: missing an image filename `test2.png' @ error/convert.c/ConvertImageComm
and/2949.
I don't know if it's because of GhostScript, ImageMagick or maybe of the WMF file itself (I don't think it's corrupted because MS Paint can read it).

When I use convert.exe on others WMF files, the command run successfully without any error messages.
All the WMFs we convert are generated by the same software, most of them can be converted to PNG without issues.

My operating system is Windows 7 professionnal, and I use ImageMagick-6.6.7-Q16 and GhostScript 9.00

Can you tell me if I can do something to solve this error ?

Thank you,
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Converting WMF to PNG issues

Post by magick »

Post a URL to your WMF so we can download it and inspect it. Until we can trace the source of the problem, we cannot help further.
pminfo01
Posts: 3
Joined: 2011-02-15T04:03:57-07:00
Authentication code: 8675308

Re: Converting WMF to PNG issues

Post by pminfo01 »

Here is two of these problematic WMF files :

test1.wmf : http://www.mediafire.com/?en09gz7g1lb8dmv

test2.wmf : http://www.mediafire.com/?27ermpl8gysm4y7

PS : Sorry for mediafire... Do you know a good website allowing to store binary files without registrering ?

Thank you
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Converting WMF to PNG issues

Post by magick »

Post this bug to the libWMF developers. There is a bug in their EPS driver. You can reproduce the problem from the command line:
  • wmf2eps -o test1.eps test1.wmf
    gs test1.eps
    Error: /undefined in -inf
The problem is two ellipses are defined with a -inf y position. If you manually change '-inf' to -1, the drawing renders without complaint.
pminfo01
Posts: 3
Joined: 2011-02-15T04:03:57-07:00
Authentication code: 8675308

Re: Converting WMF to PNG issues

Post by pminfo01 »

The libWMF project looks quite inactive. I took a look at their Sourceforge page and it's been a while since the last update...

We're going to find another solution to convert our WMFs...

Thank you for your answers,
Post Reply