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?".
sws

Problem converting WMF to JPG

Post by sws »

I'm using version IM version 6.3.9 02 to convert a WMF to a JPG. Here's what the result should look like...

Image

Here's what the convert.exe generates...

Image

Here is a link to the WMF I'm attempting to convert...

http://www.sws-corp.com/bug/pict0.wmf

I've tried several different quality and density settings but the output is always squashed together. Here are a couple command lines I've tried...

Code: Select all

convert.exe "pict0.wmf" "pict0.jpg"
convert.exe -quality 100% -density 288 "pict0.wmf" "pict0.jpg"
Please help.

Thanks!
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Problem converting WMF to JPG

Post by fmw42 »

I am no expert on wmf. In fact, I am on a Mac and cannot even use that format. But perhaps you need to upgrade to a more current version of IM.
sws

Re: Problem converting WMF to JPG

Post by sws »

I just downloaded and tested 6.6.0 10 and it produces the same results.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Problem converting WMF to JPG

Post by fmw42 »

what happens if you remove the quotes?

convert.exe pict0.wmf pict0.jpg

Note in windows % needs to be doubled as % is a special character. see http://www.imagemagick.org/Usage/windows/
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 image appears to convert properly with ImageMagick 6.6.0-10 under Linux. We'll take a closer look at the problem under Windows later this week.
sws

Re: Problem converting WMF to JPG

Post by sws »

magick wrote:The image appears to convert properly with ImageMagick 6.6.0-10 under Linux. We'll take a closer look at the problem under Windows later this week.
Thanks a lot!
sws

Re: Problem converting WMF to JPG

Post by sws »

fmw42 wrote:what happens if you remove the quotes?

convert.exe pict0.wmf pict0.jpg

Note in windows % needs to be doubled as % is a special character. see http://www.imagemagick.org/Usage/windows/
Removing the quotes has no effect.

I also tried %% but that doesn't make a difference either.

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

Re: Problem converting WMF to JPG

Post by magick »

We can reproduce the problem you posted and have a patch. Look for it in the next point release within the next few days. Thanks.
sws

Re: Problem converting WMF to JPG

Post by sws »

magick wrote:We can reproduce the problem you posted and have a patch. Look for it in the next point release within the next few days. Thanks.
That's great news. Thanks!

Would you be kind enough to tell me when its available and where I can find it? Is there any way to apply the patch to the 6.3 version I'm currently using? The motivation behind that question is I'm using Jmagick and I don't think it works with newer versions of ImageMagick.

Thanks again for the support! Great Work!
sws

Re: Problem converting WMF to JPG

Post by sws »

Never mind about the backward compatibility. I've removed JMagick from my dependencies.
sws

Re: Problem converting WMF to JPG

Post by sws »

magick wrote:We can reproduce the problem you posted and have a patch. Look for it in the next point release within the next few days. Thanks.
I just tried "ImageMagick-6.6.1-0-Q16-windows-dll.exe" and the problem remains and may be a bit worse. Here's what it should look like...

Image

Here's what version 6.3.9 produced...

Image

Here's what version 6.6.1 produces...

Image

Note the absence of this table borders and the red BAE systems logo.

Here's a link to the source WMF again.

http://www.sws-corp.com/bug/pict01.wmf

This is a extremely urgent problem we're attempting to solve for a branch of the United States military.

Please advise.

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

Re: Problem converting WMF to JPG

Post by magick »

Download ftp://ftp.imagemagick.org:/pub/ImageMag ... ws-dll.exe. Let us know if that renders the image properly.
sws

Re: Problem converting WMF to JPG

Post by sws »

magick wrote:Download ftp://ftp.imagemagick.org:/pub/ImageMag ... ws-dll.exe. Let us know if that renders the image properly.
Thanks for the quick response! Now it doesn't produce any output. Here's my console...

Code: Select all

convert "C:\temp\junk\pict01.wmf" "C:\temp\junk\pict01.jpg"
convert: unable to initialize WMF library `C:\temp\junk\pict01.wmf' @ error/wmf.c/ReadWMFImage/167.
convert: missing an image filename `C:\temp\junk\pict01.jpg' @ error/convert.c/ConvertImageCommand/2970.
Here's some output that's failing when I attempt to convert a BMP to a JPG with this patch...

Code: Select all

convert "C:\temp\junk\Picture1.BMP" "C:\temp\junk\Picture1.jpg"
convert: length and filesize do not match `C:\temp\junk\Picture1.BMP' @ error/bmp.c/ReadBMPImage/786.
Bad build maybe?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Problem converting WMF to JPG

Post by magick »

ImageMagick relies on the libWMF delegate library which returns different results under Windows than on Linux and returns different results for the EPS and GD devices. Furthermore, libWMF has not been patched since 2005. The libWMF GD device gives the closest results to your image, however, ImageMagick does not include GD support under Windows. Can you process your images under Linux or does it need to be under Windows? Otherwise you could try contacting the libWMF team and ask if they have any plans for a new release of libWMF.
sws

Re: Problem converting WMF to JPG

Post by sws »

magick wrote:ImageMagick relies on the libWMF delegate library which returns different results under Windows than on Linux and returns different results for the EPS and GD devices. Furthermore, libWMF has not been patched since 2005. The libWMF GD device gives the closest results to your image, however, ImageMagick does not include GD support under Windows. Can you process your images under Linux or does it need to be under Windows? Otherwise you could try contacting the libWMF team and ask if they have any plans for a new release of libWMF.
Windows is definitely the target platform due to other dependencies of our application.

Is there anything else you guys can do to solve this problem?

Why did I start getting the command line exceptions like this with the 6.6.1-1 patch...

Code: Select all

convert "C:\temp\junk\pict01.wmf" "C:\temp\junk\pict01.jpg"
convert: unable to initialize WMF library `C:\temp\junk\pict01.wmf' @ error/wmf.c/ReadWMFImage/167.
convert: missing an image filename `C:\temp\junk\pict01.jpg' @ error/convert.c/ConvertImageCommand/2970.
Thanks for you efforts.

Matt
Post Reply