Created
October 23, 2022 00:27
-
-
Save krispayne/536edc18f048ba8713c74c48228e3ca6 to your computer and use it in GitHub Desktop.
resize every jpeg in a dir into subdirs by size
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 | |
sizes=("3000" "1500" "1000" "750") | |
for size in "${sizes[@]}"; do | |
mkdir $size | |
for i in *.jpg; do | |
magick "$i" -resize ${size}x${size} -density 300 -units PixelsPerInch "${size}/${i}_${size}_300.jpg" | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment