Created
July 31, 2011 09:24
-
-
Save kkosuge/1116639 to your computer and use it in GitHub Desktop.
Google+に参加して無料Picasaの無限アップロード
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 'rmagick' | |
width = 2048 | |
height = 2048 | |
Dir.mkdir("./resized") unless Dir.exist?("./resized") | |
files = Dir.entries("./") | |
files.each_with_index do |file,index| | |
puts "#{index+1}/#{files.size}" | |
if file !~ /^\./ | |
begin | |
image = Magick::Image.read(file).first | |
image.resize_to_fit!(width,height) | |
image.write("./resized/gplus_#{file}") | |
rescue => e | |
puts e | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment