Skip to content

Instantly share code, notes, and snippets.

Avatar

Kestutis Stalmokas stalmok

  • Vancouver, Canada
View GitHub Profile
@stalmok
stalmok / jpegtran-directory.sh
Last active Dec 11, 2015 — forked from rik/jpegtran-directory.sh
Bash: Optimize .jpg images
View jpegtran-directory.sh
#!/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"
else
You can’t perform that action at this time.