Guest User

Untitled

a guest
Feb 19th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. size = size.map { |s| s.to_f }
  2.  
  3. aspect = size[0] > size[1] ? size[1]/size[0] : size[0]/size[1]
  4.  
  5. mould = thumb[0] > thumb[1] ? thumb[1] : thumb[0]
  6.  
  7. resize = [mould, aspect * mould]
  8.  
  9. resize = resize.reverse if size[1] > size[0]
  10.  
  11. resize
Add Comment
Please, Sign In to add comment