Created
April 9, 2014 01:32
-
-
Save mattak/10217301 to your computer and use it in GitHub Desktop.
convert size of image
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
#!/usr/bin/env ruby | |
if ARGV.size < 1 | |
puts "usage: <stdin list of files> | convertsize.rb <size>" | |
exit 0 | |
end | |
STDIN.each do |line| | |
line.chomp! | |
src = line | |
tmp = line.sub(/^(.+)\.([^\.]+)$/) { |e| "#{$1}_tmp_.#{$2}" } | |
puts "convert -geometry #{ ARGV[0] } #{src} #{tmp}; rm #{src}; mv #{tmp} #{src}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment