mirror of
https://github.com/discourse/discourse.git
synced 2025-09-04 08:47:37 +08:00
FIX: cropping GIF wasn't working
This commit is contained in:
parent
56d2626187
commit
11172b7c2d
2 changed files with 11 additions and 3 deletions
|
@ -28,7 +28,8 @@ module ImageSizer
|
|||
return [w.floor, h.floor] if w <= max_width && h <= max_height
|
||||
|
||||
ratio = max_width / w
|
||||
[max_width.floor, [max_height, (h * ratio)].min.floor]
|
||||
|
||||
[[max_width, w].min.floor, [max_height, (h * ratio)].min.floor]
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue