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

Check that orientation is still absent after reloading Exif #2

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Binary file modified Tests/images/xmp_tags_orientation_exiftool.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 7 additions & 10 deletions Tests/test_imageops.py
Expand Up @@ -345,18 +345,15 @@ def check(orientation_im):
check(orientation_im)

# Orientation from "XML:com.adobe.xmp" info key
with Image.open("Tests/images/xmp_tags_orientation.png") as im:
assert im.getexif()[0x0112] == 3

transposed_im = ImageOps.exif_transpose(im)
assert 0x0112 not in transposed_im.getexif()
for suffix in ("", "_exiftool"):
with Image.open("Tests/images/xmp_tags_orientation" + suffix + ".png") as im:
assert im.getexif()[0x0112] == 3

# Orientation from "XML:com.adobe.xmp" info key (from exiftool)
with Image.open("Tests/images/xmp_tags_orientation_exiftool.png") as im:
assert im.getexif()[0x0112] == 8
transposed_im = ImageOps.exif_transpose(im)
assert 0x0112 not in transposed_im.getexif()

transposed_im = ImageOps.exif_transpose(im)
assert 0x0112 not in transposed_im.getexif()
transposed_im._reload_exif()
assert 0x0112 not in transposed_im.getexif()

# Orientation from "Raw profile type exif" info key
# This test image has been manually hexedited from exif_imagemagick.png
Expand Down