Created
May 28, 2017 12:49
-
-
Save cinhtau/0ca6432f866c5212ffa8bba52ce4aa7b to your computer and use it in GitHub Desktop.
Resize images with ImageMagick for srcset usage for Responsive Designs/Images
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
#!/usr/bin/env bash | |
if [ ! $# == 1 ]; then | |
echo "Missing input param, file name." | |
exit 1; | |
fi | |
sizes=(1280 1024 640 320) | |
# make sizes readonly | |
declare -r sizes | |
for i in "${sizes[@]}"; do | |
convert $1 -resize "$i"x $i-$1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment