mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-04-27 12:33:41 +03:00
Do not modify EXIF of original image instance in exif_transpose()
This commit is contained in:
parent
384a4bf01e
commit
04566917f8
|
@ -302,6 +302,7 @@ def test_exif_transpose():
|
||||||
else:
|
else:
|
||||||
assert transposed_im.info["exif"] != original_exif
|
assert transposed_im.info["exif"] != original_exif
|
||||||
|
|
||||||
|
assert 0x0112 in im.getexif()
|
||||||
assert 0x0112 not in transposed_im.getexif()
|
assert 0x0112 not in transposed_im.getexif()
|
||||||
|
|
||||||
# Repeat the operation to test that it does not keep transposing
|
# Repeat the operation to test that it does not keep transposing
|
||||||
|
|
|
@ -578,7 +578,8 @@ def exif_transpose(image):
|
||||||
}.get(orientation)
|
}.get(orientation)
|
||||||
if method is not None:
|
if method is not None:
|
||||||
transposed_image = image.transpose(method)
|
transposed_image = image.transpose(method)
|
||||||
del exif[0x0112]
|
transposed_exif = transposed_image.getexif()
|
||||||
transposed_image.info["exif"] = exif.tobytes()
|
del transposed_exif[0x0112]
|
||||||
|
transposed_image.info["exif"] = transposed_exif.tobytes()
|
||||||
return transposed_image
|
return transposed_image
|
||||||
return image.copy()
|
return image.copy()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user