Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not modify EXIF of original image instance in exif_transpose() #5547

Merged
merged 1 commit into from Jun 20, 2021

Conversation

radarhere
Copy link
Member

Resolves #5546

The instance points out that in exif_transpose(),

exif = image.getexif()
...
del exif[0x0112]
transposed_image.info["exif"] = exif.tobytes()

we're deleting the orientation data from the original image's EXIF object (and then, as intended, saving it to the new image instance).

Instead, this PR changes it to

exif = image.getexif()
...
transposed_exif = transposed_image.getexif()
del transposed_exif[0x0112]
transposed_image.info["exif"] = transposed_exif.tobytes()

so that we are deleting the orientation data from the new image's EXIF object only, leaving the original image unaffected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

exif_transpose overwrites the original image exif
2 participants