Cent 7 - Build Mozjpeg

Built onCent 7.2.1511
autoconf – noarch – 2.69-11.el7 – base
automake – noarch – 1.13.4-3.el7 – base
libtool – x86_64 – 2.4.2-20.el7 – base
nasm – x86_64 – 2.10.07-7.el7 – base

Install dependencies:

yum install autoconf automake libtool nasm make

wget and untar:

mkdir /moz
cd /moz
wget https://github.com/mozilla/mozjpeg/releases/download/v3.1/mozjpeg-3.1-release-source.tar.gz
tar xzf mozjpeg-3.1-release-source.tar.gz

Build:

cd mozjpeg
./configure
make install prefix=/etc/mozjpeg libdir=/etc/mozjpeg/lib64
make install

Delete /moz and symlink

rm -rf /moz
sudo ln -s /etc/mozjpeg/bin/cjpeg /usr/bin/mcjpeg

Front-end that utilises mozjpeg and -quality:

mcjpeg -copy none -optimize -quality 70 image.jpg > compressed.jpg