Error: convert.exe: Postscript delegate failed /undefined...

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?".
Post Reply
antihero898
Posts: 3
Joined: 2014-10-23T08:45:06-07:00
Authentication code: 6789

Error: convert.exe: Postscript delegate failed /undefined...

Post by antihero898 »

I am using a java wrapper for ImageMagick called Im4Java and until recently, I started getting errors when trying to convert a .eps to .jpg. The error is the following:

org.im4java.core.CommandException: convert.exe: Postscript delegate failed `[ghostscript library] -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" -g612x792 -dEPSCrop "-sOutputFile=C:/Users/gregh/AppData/Local/Temp/magick-7684EBopBcVSBnua%d" "-fC:/Users/gregh/AppData/Local/Temp/magick-7684Ovg6DUuuB9mL" "-fC:/Users/gregh/AppData/Local/Temp/magick-7684HAO1Pls4BIg6"': Error: /undefined in Unexpected

My method is as follows:

public void convert()
{
IMOperation op = new IMOperation();
ProcessStarter.setGlobalSearchPath("C:\\Program Files\\ImageMagick-6.8.9-Q16");

op.addImage(); //in
op.addImage(); //out

ConvertCmd cmd = new ConvertCmd();

ExtensionFilter filter = new ExtensionFilter("eps");
FilenameLoader loader = new FilenameLoader(filter);

List<String> files = loader.loadFilenames("C:\\Program Files\\ImageMagick-6.8.9-Q16\\NakedWines\\Raw\\");
FilenamePatternResolver resolver = new FilenamePatternResolver("%P/%f.jpg");
for (String img: files)
{
try {
cmd.run(op,img,resolver.createName("C:\\Program Files\\ImageMagick-6.8.9-Q16\\NakedWines\\Converted\\" + img.substring(img.lastIndexOf("\\") + 1, img.length() - 3)));
} catch (IOException | InterruptedException | IM4JavaException e) {
e.printStackTrace();
}
}
}

I'm using ghostscript 9.15. Any idea what might be causing this error?
antihero898
Posts: 3
Joined: 2014-10-23T08:45:06-07:00
Authentication code: 6789

Re: Error: convert.exe: Postscript delegate failed /undefine

Post by antihero898 »

Printing the error text, I got the following:
Operand stack:, , Execution stack:, %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- --nostringval-- false 1 %stopped_push 1983 1 3 %oparray_pop 1982 1 3 %oparray_pop 1966 1 3 %oparray_pop 1852 1 3 %oparray_pop --nostringval-- %errorexec_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval--, Dictionary stack:, --dict:1193/1684(ro)(G)-- --dict:0/20(G)-- --dict:78/200(L)--, Current allocation mode is local, Current file position is 11, GPL Ghostscript 9.15: Unrecoverable error, exit code 1, @ error/ps.c/InvokePostscriptDelegate/246.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Error: convert.exe: Postscript delegate failed /undefine

Post by fmw42 »

It would appear to be something wrong with or a missing Ghostscript delegate, or your Im4Java cannot find it.
antihero898
Posts: 3
Joined: 2014-10-23T08:45:06-07:00
Authentication code: 6789

Re: Error: convert.exe: Postscript delegate failed /undefine

Post by antihero898 »

Looking at http://forums.famillecollet.com/viewtopic.php?id=2898, I was curious to see what would happen if I installed a 32 bit binary release of ImageMagick 6.8.9.0. After installing and setting the command path in my method, the conversion works perfectly.
Post Reply