Skip to content

Instantly share code, notes, and snippets.

@leomelzer
Created October 24, 2012 22:29
Show Gist options
  • Star 30 You must be signed in to star a gist
  • Fork 13 You must be signed in to fork a gist
  • Save leomelzer/3949356 to your computer and use it in GitHub Desktop.
Save leomelzer/3949356 to your computer and use it in GitHub Desktop.
Installing ImageMagick & Ghostscript on Ubuntu
  1. You have Ghostscript installed, right? Otherwise sudo apt-get install ghostscript
  2. This is important and installs the headers (iapi.h etc) which are required but don't come with the default Ghostscript package: sudo apt-get install libgs-dev
  3. I also needed sudo apt-get install gs-esp
  4. For me the pre compiled version of ImageMagick never accepted Ghostscript, so let's remove it: sudo apt-get --purge remove imagemagick
  5. Get the source of ImageMagick, untar it, cd ImageMagick-xx
  6. ./configure --with-gslib=yes [and what else you need]
  7. Confirm in the output near the bottom gslib yes yes and not gslib yes no
  8. make
  9. make install
  10. Run convert -list configure | grep DELEGATES => DELEGATES bzlib djvu freetype gs jpeg jng jp2 lcms png tiff x11 xml zlib
  11. See the gs in there? You got it!
@oscaroxy
Copy link

Hi, good work, but where is the step 7? I don't confirm nothing...
I launch "./configure --with-gslib=yes" and to end I read "gslib yes no", where "yes" is on option column and "no" is on value column... How Do I set this value to yes?

thanks

ps whole response ./configure:

ImageMagick is configured as follows. Please verify that this configuration
matches your expectations.

Host system type: x86_64-unknown-linux-gnu
Build system type: x86_64-unknown-linux-gnu

              Option                        Value

Shared libraries --enable-shared=yes yes
Static libraries --enable-static=yes yes
Module support --with-modules=no no
GNU ld --with-gnu-ld=yes yes
Quantum depth --with-quantum-depth=16 16
High Dynamic Range Imagery
--enable-hdri=no no

Delegate Configuration:
BZLIB --with-bzlib=yes yes
Autotrace --with-autotrace=no no
Dejavu fonts --with-dejavu-font-dir=default none
DJVU --with-djvu=yes no
DPS --with-dps=yes no
FFTW --with-fftw=yes no
FlashPIX --with-fpx=yes no
FontConfig --with-fontconfig=yes no
FreeType --with-freetype=yes yes
GhostPCL None pcl6 (unknown)
GhostXPS None gxps (unknown)
Ghostscript None gs (8.70)
Ghostscript fonts --with-gs-font-dir=default /usr/share/fonts/default/Type1/
Ghostscript lib --with-gslib=yes no
Graphviz --with-gvc=no
JBIG --with-jbig=yes no
JPEG v1 --with-jpeg=yes yes
JPEG-2000 --with-jp2=
LCMS v1 --with-lcms=yes no
LCMS v2 --with-lcms2=yes no
LQR --with-lqr=yes no
LTDL --with-ltdl=yes no
LZMA --with-lzma=yes no
Magick++ --with-magick-plus-plus=yes yes
MUPDF --with-mupdf=no no
OpenEXR --with-openexr=yes no
OpenJP2 --with-openjp2=yes no
PANGO --with-pango=yes no
PERL --with-perl=no no
PNG --with-png=yes yes
RSVG --with-rsvg=no no
TIFF --with-tiff=yes no
WEBP --with-webp=yes no
Windows fonts --with-windows-font-dir= none
WMF --with-wmf=no no
X11 --with-x= yes
XML --with-xml=yes yes
ZLIB --with-zlib=yes yes

X11 Configuration:
X_CFLAGS =
X_PRE_LIBS =
X_LIBS =
X_EXTRA_LIBS =

Options used to compile and link:
PREFIX = /usr/local
EXEC-PREFIX = /usr/local
VERSION = 6.8.8
CC = gcc -std=gnu99 -std=gnu99
CFLAGS = -I/usr/include/freetype2 -fopenmp -g -O2 -Wall -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
CPPFLAGS = -I/usr/local/include/ImageMagick-6
PCFLAGS = -fopenmp -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16
DEFS = -DHAVE_CONFIG_H
LDFLAGS =
MAGICK_LDFLAGS = -L/usr/local/lib
LIBS = -lfreetype -ljpeg -lpng12 -lX11 -lbz2 -lxml2 -lz -lm -lgomp
CXX = g++
CXXFLAGS = -g -O2 -pthread
FEATURES = DPC OpenMP
DELEGATES = bzlib mpeg freetype jng jpeg png ps x xml zlib

@Luisinho77
Copy link

I have the same problem, don't change the value for OpenJP2 with: ./configure --with-openjp2=yes --with-jpeg=yes

OpenJP2 --with-openjp2=yes no

Thanks in advance.

@rbatta
Copy link

rbatta commented Mar 22, 2016

Thanks for this gist! It's a bit outdated, but here's what I got to work for me on Docker for a Rails app.

  • gs-esp no longer exists
  • If installing via a Dockerfile, the order matters (see below)
  • it plays nice with imagemagick so no longer need to run make or make install 😄
FROM ruby:2.3.0

RUN apt-get update -qq && apt-get install -y \
  ghostscript \
  libgs-dev \
  imagemagick

@DaveCollinsJr
Copy link

Thanks! Simply adding "ghostscript" to our Dockerfile apt-get lines solved an issue with Rmagick, ImageMagick, and "Font not found".

@ahmadhasankhan
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment