Created
September 3, 2008 23:06
-
-
Save azisaka/8690 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size = size.map { |s| s.to_f } | |
aspect = size[0] > size[1] ? size[1]/size[0] : size[0]/size[1] | |
mould = thumb[0] > thumb[1] ? thumb[1] : thumb[0] | |
resize = [mould, aspect * mould] | |
resize = resize.reverse if size[1] > size[0] | |
resize |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment