Skip to content

Commit

Permalink
Merge pull request #8555 from radarhere/exif
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored Dec 27, 2024
2 parents 2c3395f + 185a03f commit 86d396a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/PIL/ImageOps.py
Original file line number Diff line number Diff line change
Expand Up @@ -698,10 +698,11 @@ def exif_transpose(image: Image.Image, *, in_place: bool = False) -> Image.Image
8: Image.Transpose.ROTATE_90,
}.get(orientation)
if method is not None:
transposed_image = image.transpose(method)
if in_place:
image.im = transposed_image.im
image._size = transposed_image._size
image.im = image.im.transpose(method)
image._size = image.im.size
else:
transposed_image = image.transpose(method)
exif_image = image if in_place else transposed_image

exif = exif_image.getexif()
Expand Down

0 comments on commit 86d396a

Please sign in to comment.