Created
February 12, 2015 19:30
-
-
Save greymeister/9d5b4fc66aae8296f8d0 to your computer and use it in GitHub Desktop.
Resize PNG files to 50x80
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/bash | |
export pad="60" | |
printf "%-${pad}s" "Counting files:" | |
echo `ls -1 | wc -l` | |
#printf "%-${pad}s" "Create copies of .png files" | |
# for filename in *.png; do cp "$filename" "${filename}_big.png"; done && echo "done" | |
# | |
# printf "%-${pad}s" "Create copies of .PNG files" | |
# for filename in *.PNG; do cp "$filename" "${filename}_big.png"; done && echo "done" | |
printf "%-${pad}s" "Resize each product image to 50x80" | |
for filename in *.* | |
do | |
cp "$filename" "${filename}_original" | |
convert -filter Lanczos -posterize 6 -quality 100 "$filename" -resize 50x80\> "${filename}" > /dev/null 2>&1 | |
done && echo "done" | |
# cleanup | |
# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment