ImageMagick Not Detecting Ghostscript (Ubuntu)

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
darkwingduke
Posts: 8
Joined: 2017-01-11T14:43:03-07:00
Authentication code: 1151

ImageMagick Not Detecting Ghostscript (Ubuntu)

Post by darkwingduke »

First and foremost, these are my specs:
Ubuntu 14.04
ImageMagick 6.7.7
Ghostscript 9.10
I'll list these, as well, but I don't think they're relevant to this query:
Imagick 3.4.0
PHP 5.6.18

I'm needing to work with pdf and eps files, so naturally I'm needing to utilize Ghostscript. This was already installed before I did anything with ImageMagick and I was expecting to see those two formats listed along with the default formats in ImageMagick's list of delegates, but for some reason ImageMagick did not recognize the existence of Ghostscript.

I ran the "which" command in the cli for "convert" as well as "gs" and they both appear to be within the same directory. I believe the current version for GS is 9.21 (currently running 9.10), so updating that might play into the solution, but it might not. I'm trying to avoid reinstalling ImageMagick if at all possible, but if it has to be done, it has to be done.

So, how exactly should I tackle this issue? Any feedback surrounding this would be greatly appreciated. Thanks.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: ImageMagick Not Detecting Ghostscript (Ubuntu)

Post by snibgo »

What is the text output from ...

Code: Select all

convert -verbose in.pdf out.png
If this can't find GS, a "-debug all" might give a clue.
snibgo's IM pages: im.snibgo.com
darkwingduke
Posts: 8
Joined: 2017-01-11T14:43:03-07:00
Authentication code: 1151

Re: ImageMagick Not Detecting Ghostscript (Ubuntu)

Post by darkwingduke »

Thanks for the quick reply.

I tried your suggestion and this is what I got:
$ convert -verbose test.pdf test_pdf_to_png.png
"gs" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" "-sOutputFile=/tmp/magick-SB8BEVN3-%08d" "-f/tmp/magick-KTsbOaDN" "-f/tmp/magick-HNDCwtsx"
/tmp/magick-SB8BEVN3-00000001 PNG 279x378 279x378+0+0 8-bit DirectClass 25.3KB 0.000u 0:00.000
test.pdf PDF 279x378 279x378+0+0 16-bit DirectClass 25.3KB 0.000u 0:00.000
test.pdf=>test_pdf_to_png.png PDF 279x378 279x378+0+0 8-bit PseudoClass 254c 8.19KB 0.020u 0:00.019

A png file was successfully created and since "gs" shows up on the first line of that output, I'm assuming that ImageMagick is, in fact, communicating with GS.

But, why doesn't that extension show up when I type in "convert -list configure" (a pdf, that is)?:
DELEGATES bzlib djvu fftw fontconfig freetype jbig jpeg jng jp2 lcms2 lqr lzma openexr pango png rsvg tiff x11 xml wmf zlib
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: ImageMagick Not Detecting Ghostscript (Ubuntu)

Post by dlemstra »

It's not showing up there because your version of ImageMagick is not linked with the Ghostscript library. When that happens ImageMagick will try to just execute 'gs' instead and that works because it can be found on your system.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
darkwingduke
Posts: 8
Joined: 2017-01-11T14:43:03-07:00
Authentication code: 1151

Re: ImageMagick Not Detecting Ghostscript (Ubuntu)

Post by darkwingduke »

Ah, I see.
Thank you so much for the quick replies and input. And that goes out to dlemstra and snibgo.
Post Reply