carrierwave
https://github.com/jnicklas/carrierwave
Ruby
Classier solution for file uploads for Rails, Sinatra and other Ruby web frameworks
CarrierWave::MiniMagick#manipulate!
Manipulate the image with MiniMagick. This method will load up an image and then pass each of its frames to the supplied block. It will then save the image to disk. === Gotcha This method assumes that the object responds to +current_path+. Any class that this module is mixed into must have a +current_path+ method. CarrierWave::Uploader does, so you won't need to worry about this in most cases. === Yields [MiniMagick::Image] manipulations to perform === Raises [CarrierWave::ProcessingError] if manipulation failed.
Edit
git clone [email protected]:jnicklas/carrierwave.git
cd carrierwave
open lib/carrierwave/processing/mini_magick.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-CarrierWave--MiniMagick-manipulate--for-pr
# Commit to gitgit add lib/carrierwave/processing/mini_magick.rbgit commit -m "better docs for CarrierWave::MiniMagick#manipulate!"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-CarrierWave--MiniMagick-manipulate--for-pr
hub pull-request
# Celebrate!