Having difficulties with Imagemagick and Snow Leopard.

Imagemagick was installed using the install script from here here. Everything builds and installs correctly. Imagemagick behave normally for all commands (that I can find) except when trying to convert a PDF. For example,

$ convert my.pdf my.jpg
Segmetation Fault

I thought it may be ghostscript and tried to run the command that Imagegick delegates too (via the -verbose option)

$ convert -verbose spec/fixtures/documents/upload_test_file.pdf test.jpg
"gs" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=0 "-sDEVICE=pnmraw" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72"  "-sOutputFile=/var/folders/Xz/Xz6TDr0DFQaV5J1F7Ndamk+++TM/-Tmp-/magick-4zvJXfSz" "-f/var/folders/Xz/Xz6TDr0DFQaV5J1F7Ndamk+++TM/-Tmp-/magick-O7a9fDyp" "-f/var/folders/Xz/Xz6TDr0DFQaV5J1F7Ndamk+++TM/-Tmp-/magick-rBEzLUsx"
Segmentation fault
$ "gs" -q -dQUIET -dPARANOIDSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=0 "-sDEVICE=pnmraw" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72"  "-sOutputFile=my.jpg" "-fmy.pdf"

And it works. It creates the pnmrow file as its supposed to.

I am not sure where to go from here, anyone else seen this or seen it and solved it?


As Kasper Souren answered below, I have since switched to Homebrew to manage these libraries.

  • try converting to pdf from other formats e.g tiff, png, etc. does it work? – caliban Sep 4 '09 at 21:00

Looks like the imagemagick team is aware of the problem and it was fixed in version 6.5.5-8.

The MacPorts package uses the newer version of ImageMagick as of 9/16/09. Try doing a self update and then upgrading php5-imagick.

sudo port selfupdate
sudo port upgrade php5-imagick

This fixed the problem for me.

  • I am intentionally avoiding Macports. Downloading and building from source ImageMagick-6.5.6-1 solved the problem also. Or you can use the handy install script here github.com/maddox/magick-installer – Peer Allan Sep 18 '09 at 12:46

A segmentation fault is an error with the memory handling in the program, so it would be either a bug in the build processes or in the program itself. I installed ImageMagick using MacPorts rather than building from the source on their side and the MacPorts version of ImageMagick also seems to be bugged because of ghostscript. If you open the file in Preview, the Save As... JPEG should work fine.


I messed around with this some more and have something that works using ghostscript:

  -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=0 \
  "-sDEVICE=jpeg" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 \
  "-r72x72" "-sOutputFile=out.jpeg" in.pdf

Where out.jpeg is the output file and in.pdf at the end is your input file.

You can also change -r72x72 to some other resolution if you want to tweak the output resolution higher than 72 dpi.

  • Unfortunately, we need to do this programmatically. I am wondering if it isn't something to do with 64-bit. Before updating to Snow Leopard there were no problems at all – Peer Allan Sep 5 '09 at 0:38
  • It doesn't appear to be anything with 64-bitness as it also fails on my 32-bit only MacBook. – Lara Dougan Sep 5 '09 at 2:05
  • i regards you your edit, Adam. We discovered that at about the same time you did and are having success with it. So far no luck in finding a solution so it will work how we need programmatically, but this does solve the initial problem. – Peer Allan Sep 8 '09 at 19:59
  • An alternative source for ImageMagick is macports. macports.org – orj Sep 11 '09 at 12:58

I suggest moving to Homebrew, a more modern variant of macports and fink.

brew install imagemagick
  • Agreed, this is how I have it installed now. Of course, when this question was asked it didn't exist yet. – Peer Allan Jun 5 '13 at 12:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.