Skip to content

Instantly share code, notes, and snippets.

View stalmok's full-sized avatar

Kestutis Stalmok stalmok

  • Vancouver, Canada
View GitHub Profile
@stalmok
stalmok / jpegtran-directory.sh
Last active December 11, 2015 04:39 — forked from rik/jpegtran-directory.sh
Bash: Optimize .jpg images
#!/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