Get width or height that scaling right aspect
Add this line to your application's Gemfile:
gem 'ratio_maker'
And then execute:
$ bundle
Or install it yourself as:
$ gem install ratio_maker
The standard formula
$ ratio_maker [width | height] original_width original_height [next_width | next_height]
You get next_width or next_height
For example
$ ratio_maker height 1200 626 300
You get next_height 156.5
Or
$ ratio_maker width 1200 626 50
You get next_width 95.84664536741214
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request ratio_maker
ratio maker