Page 1 of 1

CommandException message when trying to convert

Posted: 2010-10-26T13:09:10-07:00
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

Re: CommandException message when trying to convert

Posted: 2010-10-26T14:20:36-07:00
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

Re: CommandException message when trying to convert

Posted: 2010-10-27T15:26:00-07:00
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

Re: CommandException message when trying to convert

Posted: 2010-10-27T17:26:43-07:00
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)