Skip to content

Instantly share code, notes, and snippets.

@vol4ok
Created January 22, 2014 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vol4ok/8555531 to your computer and use it in GitHub Desktop.
Save vol4ok/8555531 to your computer and use it in GitHub Desktop.
mkdir output
i=1
for f in *.jpg *.JPG
do
echo "$f -> photo-$i.jpg"
cp "$f" photo-$i.jpg
gm mogrify -resize 1920x1920 photo-$i.jpg
jpegtran -outfile output/photo-$i.jpg -copy none -optimize -perfect photo-$i.jpg
rm photo-$i.jpg
(( i++ ))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment