(image, size)
| 64 | |
| 65 | |
| 66 | def resize_image(image, size): |
| 67 | # Resize such that the largest dimension is `size` |
| 68 | width, height = image.size |
| 69 | if width > height: |
| 70 | new_width = size |
| 71 | new_height = int(size * height / width) |
| 72 | else: |
| 73 | new_height = size |
| 74 | new_width = int(size * width / height) |
| 75 | return image.resize((new_width, new_height)) |
no outgoing calls
no test coverage detected