Problem converting WMF to JPG

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problem converting WMF to JPG

Post by magick »

Search Google for "libwmf Windows". Download and install libwmf for Windows. This command produces a proper rendering:
  • wmf2gd --maxsize -o pict0.png pict0.wmf
sws

Re: Problem converting WMF to JPG

Post by sws »

magick wrote:Search Google for "libwmf Windows". Download and install libwmf for Windows. This command produces a proper rendering:
  • wmf2gd --maxsize -o pict0.png pict0.wmf
Thanks for the info. I tried it. Its better but still off a little.

Here's what it should look like...

Image

Here's the output I got from wmg2gd...

Image

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

Re: Problem converting WMF to JPG

Post by magick »

The answer is outside the scope of this forum, however, try this or some variation of this command:
  • wmf2gd --maxwidth=800 --maxheight=300 --maxsize -o pict0.png pict0.wmf
sws

Re: Problem converting WMF to JPG

Post by sws »

magick wrote:The answer is outside the scope of this forum, however, try this or some variation of this command:
  • wmf2gd --maxwidth=800 --maxheight=300 --maxsize -o pict0.png pict0.wmf
Thanks for the feedback. Do you have an explanation why this command returns the wrong size...

Code: Select all

identify -format "height:%h\nwidth:%w" "C:\temp\junk\pict01.wmf"
height:53
width:52


The actual size is something like...
  • height:67
    width:381
Any thoughts?

Thanks in advance.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problem converting WMF to JPG

Post by magick »

For WMF images, ImageMagick depends on the libWMF library for the image size. 53x52 is returned by libWMF so either the meta file has this size embedded in it or there is a bug in libWMF. We have many WMF images and they seem to render properly and at the right size. We're not sure why it fails for your WMF image.
sws

Re: Problem converting WMF to JPG

Post by sws »

magick wrote:For WMF images, ImageMagick depends on the libWMF library for the image size. 53x52 is returned by libWMF so either the meta file has this size embedded in it or there is a bug in libWMF. We have many WMF images and they seem to render properly and at the right size. We're not sure why it fails for your WMF image.
In case it helps, our WMF's are extracted (indirectly) from the RTF data stored in IBM/Telelogic DOORS product. I could produce test cases if needed.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problem converting WMF to JPG

Post by magick »

The most productive path forward would be to file a bug report with the libWMF developers.
Ayusman

Re: Problem converting WMF to JPG

Post by Ayusman »

I see the same error while converting the image from pdf to tiff
Is this been solved yet?
C:\ImageMagick_6.6.1-5_Q16>convert "m1.pdf" "m1.jpg"
convert: `%s' (%d) "gswin32c.exe" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitma
p=500000000 -dEPSCrop -dAlignToPixels=0 -dGridFitTT=0 "-sDEVICE=bmpsep8" -dTextAlphaBits=4 -dGraphic
sAlphaBits=4 "-r72x72" -dUseCIEColor "-sOutputFile=C:/DOCUME~1/10154180/LOCALS~1/Temp/magick-5w1IJi
pT" "-fC:/DOCUME~1/10154180/LOCALS~1/Temp/magick-plC2YZWr" "-fC:/DOCUME~1/10154180/LOCALS~1/Temp/mag
ick-FS9oIR4k" @ error/utility.c/SystemCommand/1982.
convert: Postscript delegate failed `m1.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/6
48.
convert: missing an image filename `m1.jpg' @ error/convert.c/ConvertImageCommand/2970.
Any idea what this means. I am using IM for the first time and I have not been able to open, convert a single pdf file yet.
Is IM this complex to work with?

TIA
Ayusman
Post Reply