WMF image conversion.

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
Keerthi
Posts: 1
Joined: 2012-01-23T07:03:11-07:00
Authentication code: 8675308

WMF image conversion.

Post by Keerthi »

Hi All,
I have just started using imagemagick through im4java interface and found it very handy to deal with unconventional image fromats like EMF. I have a requirement to convert WMF image to a conventional format say, JPEG. I was able to convert an EMF image with the following piece of code.

String myPath="D:/ImageMagik/ImageMagick-6.7.4-7-Q16-windows/ImageMagick-6.7.4-7";
ProcessStarter.setGlobalSearchPath(myPath);

String imPath="D:/ImageMagik/ImageMagick-6.7.4-7-Q16-windows/ImageMagick-6.7.4-7";
ConvertCmd cmd = new ConvertCmd();
cmd.setSearchPath(imPath);

IMOperation op = new IMOperation();
op.addImage("D:/GK/test/image1.emf");
op.transform();
op.addImage("D:/GK/test/image_converted.jpg");
cmd.run(op);


But when i tried to convert a WMF image the same way, its throwing the following error.

Exception in thread "main" org.im4java.core.CommandException: org.im4java.core.CommandException: convert.exe: `%s' (%d) "gswin32c.exe" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" -g283x14 "-sOutputFile=C:/DOCUME~1/keerthi/LOCALS~1/Temp/magick-GdiH-XDQ--0000001" "-fC:/DOCUME~1/keerthi/LOCALS~1/Temp/magick-k342rrVJ" "-fC:/DOCUME~1/keerthi/LOCALS~1/Temp/magick-JQdFzFNt" @ error/utility.c/SystemCommand/1895.
at org.im4java.core.ImageCommand.run(ImageCommand.java:215)
at util.ImageMagickUtil.main(ImageMagickUtil.java:33)
Caused by: org.im4java.core.CommandException: convert.exe: `%s' (%d) "gswin32c.exe" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" -g283x14 "-sOutputFile=C:/DOCUME~1/keerthi/LOCALS~1/Temp/magick-GdiH-XDQ--0000001" "-fC:/DOCUME~1/keerthi/LOCALS~1/Temp/magick-k342rrVJ" "-fC:/DOCUME~1/keerthi/LOCALS~1/Temp/magick-JQdFzFNt" @ error/utility.c/SystemCommand/1895.
at org.im4java.core.ImageCommand.finished(ImageCommand.java:249)
at org.im4java.process.ProcessStarter.run(ProcessStarter.java:314)
at org.im4java.core.ImageCommand.run(ImageCommand.java:211)
... 1 more


Am i missing something here which is in specific to deal with WMF format. Appreciate ur help.

Thanks in advance.
Keerthi
Post Reply