Skip to content

Commit

Permalink
Merge pull request #2 from radarhere/xmp-tags-orientation
Browse files Browse the repository at this point in the history
Check that orientation is still absent after reloading Exif
  • Loading branch information
bigcat88 authored Jul 29, 2022
2 parents cce09b7 + bac83f7 commit 5d8dacf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
Binary file modified Tests/images/xmp_tags_orientation_exiftool.png
Loading
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
Original file line number Diff line number Diff line change
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

0 comments on commit 5d8dacf

Please sign in to comment.