Skip to content

Instantly share code, notes, and snippets.

@mauriciosilva
Created August 31, 2011 08:04
Show Gist options
  • Save mauriciosilva/1183051 to your computer and use it in GitHub Desktop.
Save mauriciosilva/1183051 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'mini_magick'
image_path ="/Users/mauriciosilva/Projects/akqa/audi/audi_mobile/public/images/360"
Dir.foreach(image_path) do |f|
next if f == '.' or f == '..' or f == 'sizer.rb' or f == '.DS_Store'
img = MiniMagick::Image.new(f)
w, h = img['%w %h'].split
puts "current size is #{w}x#{h}"
img.thumbnail "480x320"
w1, h1 = img['%w %h'].split
puts "current size is #{w1}x#{h1}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment