equal
deleted
inserted
replaced
56 # calc new size, preserving aspect ratio |
56 # calc new size, preserving aspect ratio |
57 if img_width > thumb_width : |
57 if img_width > thumb_width : |
58 height = max(img_height * thumb_width / img_width, 1) |
58 height = max(img_height * thumb_width / img_width, 1) |
59 width = thumb_width |
59 width = thumb_width |
60 |
60 |
61 if img_height > thumb_height : |
61 elif img_height > thumb_height : |
62 width = max(img_width * thumb_height / img_height, 1) |
62 width = max(img_width * thumb_height / img_height, 1) |
63 height = thumb_height |
63 height = thumb_height |
64 |
64 |
65 return width, height |
65 return width, height |
66 |
66 |