Created
September 20, 2017 10:53
-
-
Save bastibeckr/7dd2d93c45cebfb649c6cdff250b3353 to your computer and use it in GitHub Desktop.
gifsicle resize
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/zsh | |
sizes=( "100x56" "1024x576" "150x150" "150x80" "200x125" "250x140" "256x144" "300x169" "320x180" "400x225" "600x338" "768x432" "800x450" ) | |
filename=${1} | |
echo "Filename: ${filename:r:t}" | |
# Dirname without trailing slash | |
dirname=$(dirname ${filename}); | |
for size in "${sizes[@]}" | |
do | |
# Filename with extension WITHOUT dirname | |
targetfile="${dirname}/${filename:r:t}-${size}.gif"; | |
gifsicle --resize ${size} ${filename} > ${targetfile}; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment