mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-11 17:56:18 +03:00
Added test for empty GPS IFD
This commit is contained in:
parent
e96109b93c
commit
186a4723c8
BIN
Tests/images/empty_gps_ifd.jpg
Normal file
BIN
Tests/images/empty_gps_ifd.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
|
@ -8,6 +8,7 @@ from PIL import (
|
|||
ExifTags,
|
||||
Image,
|
||||
ImageFile,
|
||||
ImageOps,
|
||||
JpegImagePlugin,
|
||||
UnidentifiedImageError,
|
||||
features,
|
||||
|
@ -249,6 +250,24 @@ class TestFileJpeg:
|
|||
exif = reloaded._getexif()
|
||||
assert exif[gps_index] == expected_exif_gps
|
||||
|
||||
def test_empty_exif_gps(self):
|
||||
with Image.open("Tests/images/empty_gps_ifd.jpg") as im:
|
||||
exif = im.getexif()
|
||||
del exif[0x8769]
|
||||
|
||||
# Assert that it needs to be transposed
|
||||
assert exif[0x0112] == Image.TRANSVERSE
|
||||
|
||||
# Assert that the GPS IFD is present and empty
|
||||
assert exif[0x8825] == {}
|
||||
|
||||
transposed = ImageOps.exif_transpose(im)
|
||||
exif = transposed.getexif()
|
||||
assert exif[0x8825] == {}
|
||||
|
||||
# Assert that it was transposed
|
||||
assert 0x0112 not in exif
|
||||
|
||||
def test_exif_rollback(self):
|
||||
# rolling back exif support in 3.1 to pre-3.0 formatting.
|
||||
# expected from 2.9, with b/u qualifiers switched for 3.2 compatibility
|
||||
|
|
Loading…
Reference in New Issue
Block a user