Skip to content

Instantly share code, notes, and snippets.

@krispayne
Created October 23, 2022 00:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krispayne/536edc18f048ba8713c74c48228e3ca6 to your computer and use it in GitHub Desktop.
Save krispayne/536edc18f048ba8713c74c48228e3ca6 to your computer and use it in GitHub Desktop.
resize every jpeg in a dir into subdirs by size
#!/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