Created
May 24, 2016 21:29
-
-
Save jamesmichiemo/7a09fc47af0ba3ace653796fd9a60114 to your computer and use it in GitHub Desktop.
batch rotate images with imagemagick
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
| Dir.glob("**/*.jpg").each do |filename| | |
| new_filename = File.join( | |
| File.dirname(filename), | |
| "#{File.basename(filename, ".jpg")}-180.jpg") | |
| `convert "#{filename}" -rotate 180 "#{new_filename}"` | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment