Skip to content

Instantly share code, notes, and snippets.

@dikaio
Created July 3, 2023 05:23
Show Gist options
  • Save dikaio/cf9f9efab2b3e4583464746bc9247f47 to your computer and use it in GitHub Desktop.
Save dikaio/cf9f9efab2b3e4583464746bc9247f47 to your computer and use it in GitHub Desktop.
One line command to bulk convert image sizes as long as their are greater than the size being converted to.

find . -type f -name "*.jpg" -exec identify -format '%w %i\n' "{}" \; | awk '$1 > 800 {print $2}' | xargs -I {} convert "{}" -resize 800x "{}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment