Progressive/interlacd jpeg on Linux


How to install jpegtran

apt-get install libjpeg-progs


Script found here

#!/usr/bin/env bash

function optimize
echo $1
filesize=`stat –format=%s “$1″`
if [[ $filesize -lt 10000 ]]; then
jpegtran -copy none -optimize “$1” > “$1.bak”
echo “pet”
jpegtran -copy none -progressive “$1” > “$1.bak”
echo “grand”

if [[ $filesize -lt `stat –format=%s “$1.bak”` ]]; then
echo “compression plus lourde”
rm “$1.bak”
echo “good!”
mv “$1.bak” “$1”
find . -name ‘*.jpg’ -type f -print0 |while read -d $’\0′ i; do optimize “$i”; done

Or you can use also image magic

find . -name ‘*.jpg’ -exec convert -strip -interlace Plane -quality 80 {} {} \;

Check if it is interlaced

find . -name ‘*.jpg’ | xargs identify -verbose *.jpg | grep Interlace

Mount your bucket with s3fs


s3fs -o use_cache=/tmp/cache mybucket /mnt/s3


how to install



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s