Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Resize PNG files to 50x80
#!/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