Created
December 22, 2015 09:22
-
-
Save danyeah/b310920a671a5b8cedbc to your computer and use it in GitHub Desktop.
Bulk mozjpeg optimizer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
#this is where your files will be put | |
mkdir originals | |
# I run mozjpeg for everyfile in this dir, adding the suffix .tmp, and move the original file in /originals | |
for f in ./*.jpg; | |
do | |
mozjpeg -optimize -outfile $f.tmp $f; | |
mv $f originals/$f; | |
done | |
# fir evry .tmp i rename it without the extension, | |
for f in ./*.tmp; | |
do | |
mv $f "${f%.*}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment