having issue as report here http://drupal.org/comment/reply/794596/2949790 (point 4*)

imagemagick is on server and working for other imagecache stuff, can't seem to find gs (ghostscript) on server tho and can't update

would really love to get this working!

Comments

loophole080’s picture

so... tried this: http://drupal.org/node/460132 and getting no image generated, so thinking it's because ghostscript missing on my server :-/

iamsoclever’s picture

You might check your Apache config to make sure the binaries are in the allowed executable environment. If not, create a symlink to where they need to be.

loophole080’s picture

thanks but seems i don't have the write privs required with my hosting package... may try installing ghostcript in home dir and including in $PATH, but now sure that'll work for apache... which is presumably the cause of issue....?

dman’s picture

Debug notes, I found the same thing when building up a brand new machine with hardly any dependencies already installed.
Just to be odd, It's OSX 10.7.3 Lion.
I'm using fink packages to manage all the debian downloads. It works out pretty much like apt-get, though it seems to recompile everything from source each time.

sudo fink -v install imagemagick

(downloaded 169 other libraries and compiled them all - 2 hours later ...)

$ which convert
/sw/bin/convert
$ convert --version
Version: ImageMagick 6.5.8-10 2012-03-08 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: HDRI 

$ which gs
/sw/bin/gs
$ gs --version
9.02

I'd added the path to convert in the imagemagick settings, and it said things were fine.
HOWEVER, I still got

"sh: gs: command not found convert: Postscript delegate failed"

Reading between the lines (and a dozen other help threads) - imagemagick was trying to run the 'gs' (ghostscript) command as part of its process, and 'gs' wasn't available.

I had the imagemagick API debug options on, and it told me the command that was being run was

ImageMagick command: /sw/bin/convert -density 40x40 'sites/pdf_to_imagefield.drupal6.gizmo/files/pdf/Timesheet Details_ Dan Morrison.pdf[0]' 'sites/pdf_to_imagefield.drupal6.gizmo/files/pdf/1-0.jpg'

When I ran that by hand - it worked so my libraries were there, just the php/apache environment was the problem.

It seems that the Apache user wasn't aware of /sw/bin as a thing it should have in its $PATH. (though when I su to www it's there OK)
I tried putting
export PATH="$PATH:/sw/bin"
into a few places, but I remember getting messed up with this before (eg apache setenv etc) and it got unmaintainable.

IN THE END, I just went

sudo ln -s /sw/bin/gs /usr/local/bin/gs

and things started working once again.

This isn't much help on a shared server of course, but maybe my diagnostics can give you some clues how to fix it on your own system.

queenvictoria’s picture

Good tip @dman. On OS X 10.9 I did
$ sudo ln -s `which gs` /usr/bin/gs

dman’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)

Closing 6.x issues as unsupported.

danjordan’s picture

Hi. I know this is a closed issue but thought I would post that I was having the same issue on a new Mac machine running Yosemite and version 7.x-3.3+22-dev of module. Drupal logs showed

pdf_to_image_shell_exec did not create image /Users/myname/www/project/src/sites/default/files/document_images/330-0.jpg as expected. convert: no images defined `/Users/myname/www/project/src/sites/default/files/document_images/330-0.jpg' @ error/convert.c/ConvertImageCommand/3187.

Running
$ sudo ln -s `which gs` /usr/bin/gs
resolved the issue.

webservant316’s picture

I am getting this related error...

pdf_to_image_shell_exec did not create image .../sites/default/files/453-0.jpg as expected. sh: gs: No such file or directory convert: Postscript delegate failed `.../sites/default/files/files-webpage/2015/220/pdf-shorty.pdf': No such file or directory @ pdf.c/ReadPDFImage/611. convert: missing an image filename `.../sites/default/files/453-0.jpg' @ convert.c/ConvertImageCommand/2800.

I hope to try to ln -s and report back with my results.