Created
June 24, 2016 09:15
-
-
Save probil/074743f08a34ae610d7dbe987b246bbf to your computer and use it in GitHub Desktop.
This file contains hidden or 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/bash | |
# This script will find all *.gif in current directory | |
# and convert in to max height with aspect ratio and | |
# apply maximum optimization. | |
# ============================ | |
# You need to install `gifsicle` first | |
# Create dir if not exists | |
if [ ! -d "$DIRECTORY" ]; then | |
mkdir "./resize/" | |
fi | |
for f in `find . -name "*.gif"` | |
do | |
filename="${f##*/}" | |
dirn="${fspec%/*}" | |
result_path="./resize/${filename}"; | |
# print current file name | |
echo $f | |
# do conversion | |
gifsicle --resize-fit-height 60 -O3 -i $f > $result_path | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment