Issue working with ImageMagick and Ghostscript
Posted: 2016-04-19T18:47:18-07:00
I am triggering PDF>JPG conversion through Terascript (middleware) calling a shell script. If I construct the command manually and enter it on the command line it works. If I trigger the same command from the middleware it doesn't.
Environment is Mac OS X 10.10.5 Yosemite, Apache 2.4, Terascript 7, ImageMagick 6.9.3-6, Ghostscript 9.19.
Surprisingly this set up has been working for years on Mac OS X 10.7.5 Lion, Apache 2.2, Terascript 6.21, ImageMagick 6.7.6-0, Ghostscript 9.05.
I can confirm that ImageMagick is running fine and can resize images. The error occurs when calling gs (Ghostscript). The error is:
Things I have tried are:
Edit the delegates.xml file to include an absolute reference to gs (/usr/local/bin/gs).
Changing permissions so Everyone has Execute privileges for gs.
Running gs directly from the script (works, but doesn't answer the question)
Things I am yet to try:
Checking the command syntax. Apparently it shouldn't have changed much between these versions but will in future.
Code: Select all
sudo -u username -p password /opt/local/bin/convert -thumbnail 215x300 /file/path/source.pdf[0] -flatten /file/path/target.jpg
Surprisingly this set up has been working for years on Mac OS X 10.7.5 Lion, Apache 2.2, Terascript 6.21, ImageMagick 6.7.6-0, Ghostscript 9.05.
I can confirm that ImageMagick is running fine and can resize images. The error occurs when calling gs (Ghostscript). The error is:
Code: Select all
convert: FailedToExecuteCommand `"/usr/local/bin/gs"... @ error/delegate.c
Edit the delegates.xml file to include an absolute reference to gs (/usr/local/bin/gs).
Changing permissions so Everyone has Execute privileges for gs.
Running gs directly from the script (works, but doesn't answer the question)
Things I am yet to try:
Checking the command syntax. Apparently it shouldn't have changed much between these versions but will in future.