Created
April 23, 2019 02:50
-
-
Save ohjho/5e0132d35e5c45451d472a50df92915e to your computer and use it in GitHub Desktop.
imgmagick resize batch sub directory (replace . with your dir path)
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
find . -type f -iname "*.jpg" -exec identify -format '%w %h %i\n' {} \; | | |
awk '$1 > 1200 || $2 > 1200 {sub(/^[^ ]* [^ ]* /, ""); print}' | | |
tr '\n' '\0' | | |
xargs -0 mogrify -resize '1200x1200' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment