Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'rubygems'
- require 'carrierwave'
- require 'fileutils'
- # needed for the RMagick module in CarrierWave
- def current_path
- @current_path
- end
- include CarrierWave::RMagick
- original_path = "/Users/kevinsmith/Desktop/carrierwave/images"
- modified_path = "/Users/kevinsmith/Desktop/carrierwave/modified"
- w = 262
- h = 262
- Dir.chdir(original_path)
- Dir['*'].each do |f|
- FileUtils.cp(File.join(Dir.pwd, f), modified_path)
- @current_path = File.join(modified_path, f)
- #resize_to_fit(w, h)
- resize_to_fill(w, h, ::Magick::NorthWestGravity)
- #resize_and_pad(w, h, :transparent, ::Magick::CenterGravity)
- #resize_to_limit(w, h)
- end
Add Comment
Please, Sign In to add comment