I have a perl program that is converting a pdf file to a jpg using
imagemagik and gs. Using the following command line in a telnet shell
logged in as the webmaster and in the same directory as the perl
program it works:
cd Pages;/usr/local/bin/convert ZGRH3122CHAP070827063618-1-1.pdf -
resize 300 ZGRH3122CHAP070827063618-1-1.jpg
But when I do it in perl with the following:
system("cd $displaypath;/usr/local/bin/convert $THISPROJECT
$thepagemap[$i].pdf -resize 300 $THISPROJECT$thepagemap[$i].jpg");
which expands out to (same as above):
cd Pages;/usr/local/bin/convert ZGRH3122CHAP070827063618-1-1.pdf -
resize 300 ZGRH3122CHAP070827063618-1-1.jpg
I get this error:
sh: gs: command not found
convert: Postscript delegate failed
`ZGRH3122CHAP070827063618-1-1.pdf'.
convert: missing an image filename `ZGRH3122CHAP070827063618-1-1.jpg'.
Anyone have any clue why I would get this error? Convert works fine,
it just doesn't work with gs (ghostscript) when I call it from the
perl (but does work at the command prompt). Also gs is in /usr/local/bin same as convert.
Bill H
Convert and GS
Re: Convert and GS
The gs program is in your path when you execute the command from the shell but not when you execute it in your Perl script. Add the proper path to your Perl script or edit ImageMagick's delegates.xml configuration file and change the gs program to a fully-qualified path such as /usr/local/bin/gs.
Re: Convert and GS
Thanks - this will help. If I want to edit the delegates.xml - where do I find it?magick wrote:The gs program is in your path when you execute the command from the shell but not when you execute it in your Perl script. Add the proper path to your Perl script or edit ImageMagick's delegates.xml configuration file and change the gs program to a fully-qualified path such as /usr/local/bin/gs.
Re: Convert and GS
magick wrote:The gs program is in your path when you execute the command from the shell but not when you execute it in your Perl script. Add the proper path to your Perl script or edit ImageMagick's delegates.xml configuration file and change the gs program to a fully-qualified path such as /usr/local/bin/gs.
I think I found it. In the config folder where I origanally "made" it. Do I change all instances of command='"gs" to command='"/usr/local/bin/gs" and then remake imagemagick?
Re: Convert and GS
After a little looking I found the correct config and modified it, works great! Thanks.elcorazon wrote:magick wrote:The gs program is in your path when you execute the command from the shell but not when you execute it in your Perl script. Add the proper path to your Perl script or edit ImageMagick's delegates.xml configuration file and change the gs program to a fully-qualified path such as /usr/local/bin/gs.
I think I found it. In the config folder where I origanally "made" it. Do I change all instances of command='"gs" to command='"/usr/local/bin/gs" and then remake imagemagick?