Last active
March 27, 2016 21:45
-
-
Save innermond/0fb526cc30cea81bbc10 to your computer and use it in GitHub Desktop.
rotate a portrait jpg file to a landscape, resize it and cropp it
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
| for f in *.jpg; do wh=$(convert "$f" -ping -format '%w %h' info:); w="${wh%\ *}"; h="${wh#*\ }";[[ h -gt w ]] && echo portrait && mogrify -rotate -90 "$f" || echo landscape; mogrify -resize 220x -gravity center -crop 220x122 done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment