Page 1 of 2

Problem converting WMF to JPG

Posted: 2010-03-31T11:41:16-07:00
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!

Re: Problem converting WMF to JPG

Posted: 2010-03-31T12:03:34-07:00
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.

Re: Problem converting WMF to JPG

Posted: 2010-03-31T12:22:36-07:00
by sws
I just downloaded and tested 6.6.0 10 and it produces the same results.

Re: Problem converting WMF to JPG

Posted: 2010-03-31T12:26:47-07:00
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/

Re: Problem converting WMF to JPG

Posted: 2010-03-31T12:30:48-07:00
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.

Re: Problem converting WMF to JPG

Posted: 2010-03-31T12:47:27-07:00
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!

Re: Problem converting WMF to JPG

Posted: 2010-03-31T12:49:55-07:00
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.

Re: Problem converting WMF to JPG

Posted: 2010-03-31T12:57:48-07:00
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.

Re: Problem converting WMF to JPG

Posted: 2010-03-31T13:06:44-07:00
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!

Re: Problem converting WMF to JPG

Posted: 2010-04-01T08:38:25-07:00
by sws
Never mind about the backward compatibility. I've removed JMagick from my dependencies.

Re: Problem converting WMF to JPG

Posted: 2010-04-05T09:02:40-07:00
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.

Re: Problem converting WMF to JPG

Posted: 2010-04-05T11:49:17-07:00
by magick
Download ftp://ftp.imagemagick.org:/pub/ImageMag ... ws-dll.exe. Let us know if that renders the image properly.

Re: Problem converting WMF to JPG

Posted: 2010-04-05T13:46:28-07:00
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?

Re: Problem converting WMF to JPG

Posted: 2010-04-05T19:35:50-07:00
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.

Re: Problem converting WMF to JPG

Posted: 2010-04-06T08:02:24-07:00
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