Created
January 22, 2010 08:49
-
-
Save mmichelli/283631 to your computer and use it in GitHub Desktop.
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
require 'rubygems' | |
require "find" # to use command-line "find" to go through subdirectories for files | |
require 'RMagick' | |
@in_dir = ARGV[0] | |
Find.find(@in_dir) do |path| | |
if !FileTest.directory?(path) && (path[-4,4] == ".jpg") | |
puts path | |
puts "reading " | |
img = Magick::Image::read(path).first.resize_to_fit(1000,1000) | |
puts "writeing " | |
img.write(path) { self.quality = 100 } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment