Open radarhere opened 6 days ago
im.transpose() loads the image, calls the core transpose() method and returns a new image instance. https://github.com/python-pillow/Pillow/blob/5bff2f3b2894ec6923c590d0c37b18177d0634bd/src/PIL/Image.py#L2982-L2994
im.transpose()
transpose()
When im.transpose() is called from ImageOps.exif_transpose(), if it is in_place, then the image is already loaded, and the new image instance is quickly abandoned. https://github.com/python-pillow/Pillow/blob/5bff2f3b2894ec6923c590d0c37b18177d0634bd/src/PIL/ImageOps.py#L701-L705
ImageOps.exif_transpose()
in_place
So this can be simplified to just calling the core transpose() method directly.
im.transpose()
loads the image, calls the coretranspose()
method and returns a new image instance. https://github.com/python-pillow/Pillow/blob/5bff2f3b2894ec6923c590d0c37b18177d0634bd/src/PIL/Image.py#L2982-L2994When
im.transpose()
is called fromImageOps.exif_transpose()
, if it isin_place
, then the image is already loaded, and the new image instance is quickly abandoned. https://github.com/python-pillow/Pillow/blob/5bff2f3b2894ec6923c590d0c37b18177d0634bd/src/PIL/ImageOps.py#L701-L705So this can be simplified to just calling the core
transpose()
method directly.