comparison sat/tools/image.py @ 3477:9498f32ba6f7

tools (image): fix bad method name used when `fix_orientation` is set in `resize`
author Goffi <goffi@goffi.org>
date Fri, 19 Mar 2021 14:01:51 +0100
parents 1512cbd6c4ac
children be6d91572633
comparison
equal deleted inserted replaced
3476:11003f9f92fb 3477:9498f32ba6f7
72 def _resize_blocking(image_path, new_size, dest, fix_orientation): 72 def _resize_blocking(image_path, new_size, dest, fix_orientation):
73 im_path = Path(image_path) 73 im_path = Path(image_path)
74 im = Image.open(im_path) 74 im = Image.open(im_path)
75 resized = im.resize(new_size, Image.LANCZOS) 75 resized = im.resize(new_size, Image.LANCZOS)
76 if fix_orientation: 76 if fix_orientation:
77 resized = ImageOps.fix_orientation(resized) 77 resized = ImageOps.exif_transpose(resized)
78 78
79 if dest is None: 79 if dest is None:
80 dest = tempfile.NamedTemporaryFile(suffix=im_path.suffix, delete=False) 80 dest = tempfile.NamedTemporaryFile(suffix=im_path.suffix, delete=False)
81 elif isinstance(dest, Path): 81 elif isinstance(dest, Path):
82 dest = dest.open('wb') 82 dest = dest.open('wb')