Refile::Optimizer
Refile + mini magick + image optimization
Installation
Add this line to your application's Gemfile:
gem "refile-optimizer"
Add this line for no rails apps:
require "refile/optimizer"
Check image_optim for binaries instalation.
NOTE: For now, you need to require refile-mini_magick from master.
gem "refile-mini_magick", github: "refile/refile-mini_magick"
Usage
All the mini-magick processing helpers are available plus:
- /attachments/:token/:backend_name/convertoptim/jpg/:id
- /attachments/:token/:backend_name/filloptim/500/500/:id
- /attachments/:token/:backend_name/fitoptim/500/500/:id
- /attachments/:token/:backend_name/limitoptim/500/500/:id
- /attachments/:token/:backend_name/padoptim/500/500/:id
- /attachments/:token/:backend_name/resampleoptim/500/500/:id
The image gets processed by mini-magic and then passed to image_optim to get its optimized version.
Development
After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/stacksocial/refile-optimizer. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
The gem is available as open source under the terms of the MIT License.