Closed worikgh closed 4 months ago
Unless you check out an older version of magick-rust, you will need to use ImageMagick version 7, which basically requires building it from source. Note that in order to load basically any images at all, you will need to install the requisite image libraries (e.g. libjpeg-dev
, libpng-dev
), otherwise you get the dreaded "failed to read file" error (ImageMagick return codes are 1 (good) or 0 (bad), so no help in debugging issues).
Here is how to get it compiled and tested. Note that this is a fresh install of bookworm in a VM, in which I install all prerequisites, including Rust and the image libraries:
sudo apt-get update
sudo apt-get install build-essential clang curl git pkg-config libjpeg-dev libjpeg-turbo-progs libpng-dev
wget https://imagemagick.org/archive/ImageMagick.tar.gz
tar axf ImageMagick.tar.gz
cd ImageMagick-7.1.1-31/
./configure --with-magick-plus-plus=no --with-perl=no
make
sudo make install
cd ..
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
. .cargo/env
git clone https://github.com/nlfiedler/magick-rust.git
cd magick-rust/
cargo build
cargo test
Added an INSTALL.md
guide that provides tested instructions for building on Ubunut Linux. The example above is slightly wrong, at least for Ubuntu 24.04 (replace libjpeg-turbo-progs
with libjpeg-dev
).
On Debian 12 I cloned the repository and ran
cargo
build`magick-rust$ PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig cargo build
I get the error:
But: