1

I've tried to find a simple explanation for several hours but I just can't seem to find anything useful. I'm primarily a Windows programmer with some experience with Linux-based OSes. For some reason doing apt install imagemagick only gives me a really old version (pre-2012) and there's a change in the later versions that I need, which means I need to build from source.

Compiling IM 7 on Ubuntu 18.04 is simple enough: Download tar.gz, extract, ./configure, make and make install. However it seems that PNG support is not included by default (why??).

I've tried doing ./configure --with-png but that didn't achieve anything (I see --with-png=yes no, which presumably means "yes, you've asked for PNG support but no, I haven't given it to you"). I've seen many forum posts and SE questions about this, but everyone asking seems to have some prior knowledge which I am clearly missing and the questions appear to be about some later step in the process.

So, what do I actually need to do to get PNG support?

(And as some bonus questions: Why is there no documentation for this? Why does it not include PNG support out of the box? Why are there no prebuilt binaries for Ubuntu?)

Related question: Imagemagick still exists after apt remove?

  • Have you installed libpng and libpng-devel with apt? The png support is enabled by default in 7.x and should work. – frozendwarf Mar 12 at 0:14
  • Try to install it using apt first. It should install dependencies. Then remove imagemagick without removing its dependencies and try again your manual compilation. – Gryu Mar 12 at 0:27
  • @Gryu How do I remove imagemagick without removing its dependencies? – Clonkex Mar 12 at 0:29
  • sudo apt remove imagemagick removes only imagemagick. What is your imagemagick version from repositories? – Gryu Mar 12 at 0:31
  • 1
    @Gryu If you mean the version I get with apt install, it said Version: ImageMagick 6.9.7-4 Q16 x86_64 20170114. Though since building from source I seem to only get the new (PNG-less) version when I run (for example) magick -version – Clonkex Mar 12 at 0:37
0

I am not sure what error message you were getting, but I was getting convert: no decode delegate for this image format `JPG' @ error/constitute.c/ReadImage/562 when working with jpegs with a fresh ImageMagick install from source.

To resolve it:

  1. uncomment deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted in /etc/apt/sources.list

  2. install dependencies

sudo apt update
sudo apt build-dep imagemagick
  1. Reinstall ImageMagick
./configure
make
sudo make install
sudo ldconfig /usr/local/lib

source: https://linuxconfig.org/how-to-install-imagemagick-7-on-ubuntu-18-04-linux

| improve this answer | |

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.