CommandException message when trying to convert

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
nutz

CommandException message when trying to convert

Post by nutz »

hi, I'm not sure i open this topic in the right place, please correct me.

i try to convert an image. the convert command is called from im4java package, and i get the following error message:

org.im4java.core.CommandException: org.im4java.core.CommandException: convert.exe: `%s': %s "gswin32c.exe" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dEPSCrop -dAlignToPixels=0 -dGridFitTT=0 "-sDEVICE=pnmraw" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" "-sOutputFile=C:/Windows/TEMP/magick-UPnguOUM" "-fC:/Windows/TEMP/magick-r8E3mr8h" "-fC:/Windows/TEMP/magick-C8slHwLo" @ utility.c/SystemCommand/1964.
at org.im4java.core.ImageCommand.run(ImageCommand.java:215)

any idea what's wrong?
the only thing i see there that might be an issue is that default value for the -sOutputFile parameter. how can i change that paramter?

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

Re: CommandException message when trying to convert

Post by fmw42 »

two possibilities:

1) convert.exe may be the windows internal convert -- so rename the IM convert to im_convert.exe

2) you may need to provide the full path to the IM convert
nutz

Re: CommandException message when trying to convert

Post by nutz »

hi,
thank you so much for your quick reply.
however, i still have the problem.
first, i tried to reinstall the IM using the 32bit, since the first time was with the 64bit (that what i believe my server uses), but it didn't help.
when i changed the convert.exe to im_convert.exe, in the prompt i can call it without a problem, but through the java call it still fails.
i also supplied the command with the file path :
File file = new File(fileName + srcExtention);
String srcFile = file.getCanonicalPath();
file = new File(fileName + targetExtention);
String targetFile = file.getCanonicalPath();
// execute the operation
System.out.println("calling ImageMagick convert from: "+srcFile+" to: "+targetFile);
try {
cmd.run(op, srcFile, targetFile);
} catch (CommandException ce) {handleException(ce);
} catch (Exception e) {handleException(e);
}
but nothing good here either.

can you please think about more possible solutions?

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

Re: CommandException message when trying to convert

Post by fmw42 »

Be sure you have the correct file to IM convert and use that in your command

fullpathto/im_convert.exe ....

you may also need the proper paths to your images.


Other than that, I probably can be of no further use. I am not a Windows expert. I run on a Mac (unix)
Post Reply