Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kkosuge
Created July 31, 2011 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkosuge/1116639 to your computer and use it in GitHub Desktop.
Save kkosuge/1116639 to your computer and use it in GitHub Desktop.
Google+に参加して無料Picasaの無限アップロード
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