image_science
Clean and happy thumbnail generation.
ImageScience is a clean and happy Ruby library that generates thumbnails – and kicks the living crap out of RMagick. Oh, and it doesn’t leak memory like a sieve. :)
- Glorious graphics manipulation magi… errr, SCIENCE! in less than 300 LoC!
- Supports square and proportional thumbnails, as well as arbitrary resizes.
- Pretty much any graphics format you could want. No really.
1 2 3 4 5 6 7 8 9 |
ImageScience.with_image file do |img| img.cropped_thumbnail 100 do |thumb| thumb.save "#{file}_cropped.png" end img.thumbnail 100 do |thumb| thumb.save "#{file}_thumb.png" end end |
Get The Code
If you just want to use image_science, you can install it via RubyGems:gem install image_science
If you want to hack on image_science, clone it from GitHub:
git clone git://github.com/seattlerb/image_science