Modify an existing image on disk to make it landscape aspect. Args: file_path: The path of the image on disk.
(file_path: Path)
| 53 | |
| 54 | |
| 55 | def make_landscape(file_path: Path) -> None: |
| 56 | ''' |
| 57 | Modify an existing image on disk to make it landscape aspect. |
| 58 | |
| 59 | Args: |
| 60 | file_path: The path of the image on disk. |
| 61 | ''' |
| 62 | image = Image.open(file_path) |
| 63 | if image.size[0] < image.size[1]: |
| 64 | rotated_image = image.rotate(90, expand=True) |
| 65 | rotated_image.save(file_path) |
| 66 | |
| 67 | |
| 68 | def make_mixed_image(srca_path: Path, srcb_path: Path, dst_path: Path) -> None: |
no outgoing calls
no test coverage detected