Skip to content

Commit

Permalink
Merge pull request #5547 from radarhere/exif
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Jun 20, 2021
2 parents 8b0244a + 0456691 commit 7c08565
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions Tests/test_imageops.py
Expand Up @@ -302,6 +302,7 @@ def check(orientation_im):
else:
assert transposed_im.info["exif"] != original_exif

assert 0x0112 in im.getexif()
assert 0x0112 not in transposed_im.getexif()

# Repeat the operation to test that it does not keep transposing
Expand Down
5 changes: 3 additions & 2 deletions src/PIL/ImageOps.py
Expand Up @@ -578,7 +578,8 @@ def exif_transpose(image):
}.get(orientation)
if method is not None:
transposed_image = image.transpose(method)
del exif[0x0112]
transposed_image.info["exif"] = exif.tobytes()
transposed_exif = transposed_image.getexif()
del transposed_exif[0x0112]
transposed_image.info["exif"] = transposed_exif.tobytes()
return transposed_image
return image.copy()

0 comments on commit 7c08565

Please sign in to comment.