ImageMagick is great. It allows your web app to process, resize, filter, and do all kinds of other nifty things with images.
Not so long ago, ImageMagick 7 was released. One of the big new features was full support for WEBP images, the new image format from Google.
Now, you might think it’s easy to just upgrade to ImageMagick 7. If you’re using a linux OS like Ubuntu, you just apt install and you’re done, right?
Well, no…
As usual, we don’t get the latest and greatest packages – at least not in Ubuntu Server 18.04 LTS.
That means we need to install ImageMagick 7 from source.
And that usually means that something won’t work…
But fear not! Despite a severe lack of info on The Internets, I managed to get it to work:
Step 1: Uninstall your old ImageMagick by doing:
apt remove imagemagick imagemagick-6-common
Step 2: Just in case, install all the build dependencies for ImageMagick:
apt build-dep imagemagick
Step 3: Install image libraries, including WEBP:
apt-get install checkinstall libwebp-dev libopenjp2-7-dev librsvg2-dev libde265-dev
Step 4: Install ImageMagick (latest) from source:
wget https://www.imagemagick.org/download/ImageMagick.tar.gz tar xzvf ImageMagick.tar.gz
cd to the extracted directory, and then run:
./configure --enable-shared --with-modules --with-gslib make make install ldconfig /usr/local/lib identify -version
Ta-DA!!! You’re done!
Note that the ./configure stuff with the options above is very important. Otherwise, stuff won’t work.
Now you can move along and use ImageMagick 7, install RMagick 4.x in your rails app, or whatever…
What’s more, your app will now support the processing of WEBP images in ImageMagick!
It’s “Teh Internets”, Scotty. Get it right! 😄
works great! thanks! Stephan
Installing ImageMagick 7 in linux from source is a pain because there are lots of optional packages needed to support all of ImageMagick’s “delegates” (image formats). The compile will succeed, but the resulting install will be missing support for common formats (PNG, TIFF, etc.).
I *strongly* suggest using ImageMagick Easy Install (IMEI):
https://github.com/SoftCreatR/imei/
Not only does it take care of all this for you, but it can also incrementally update your local install after the initial installation.
Thanks, it worked! I really needed this assistance, I would have been helpless without it and I really needed ImageMagick 7 to process a GeoTIFF.
There was a hiccup when it told me “You must put some ‘deb-src’ URIs in your sources.list” at the `sudo apt build-dep imagemagick` step, but a quick google showed me to just check the box for ‘Source Code’ under the Ubuntu Software tab in the Settings section of the Software and Updates tool.
Where is the extracted directory?!
Just do “ls -la” and find the name. The compressed file will decompress into a folder, but the name of the folder changes depending on the specific version of ImageMagick at the time you download it.