mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Fixed bug in Exif __delitem__
This commit is contained in:
parent
e80f06147b
commit
7a1f0f6a8f
|
@ -650,12 +650,14 @@ class TestImage:
|
|||
with Image.open("Tests/images/exif-72dpi-int.jpg") as im: # Little endian
|
||||
exif = im.getexif()
|
||||
assert 258 not in exif
|
||||
assert 274 in exif
|
||||
assert 40960 in exif
|
||||
assert exif[40963] == 450
|
||||
assert exif[11] == "gThumb 3.0.1"
|
||||
|
||||
out = str(tmp_path / "temp.jpg")
|
||||
exif[258] = 8
|
||||
del exif[274]
|
||||
del exif[40960]
|
||||
exif[40963] = 455
|
||||
exif[11] = "Pillow test"
|
||||
|
@ -663,6 +665,7 @@ class TestImage:
|
|||
with Image.open(out) as reloaded:
|
||||
reloaded_exif = reloaded.getexif()
|
||||
assert reloaded_exif[258] == 8
|
||||
assert 274 not in reloaded_exif
|
||||
assert 40960 not in reloaded_exif
|
||||
assert reloaded_exif[40963] == 455
|
||||
assert reloaded_exif[11] == "Pillow test"
|
||||
|
|
|
@ -3466,7 +3466,8 @@ class Exif(MutableMapping):
|
|||
def __delitem__(self, tag):
|
||||
if self._info is not None and tag in self._info:
|
||||
del self._info[tag]
|
||||
del self._data[tag]
|
||||
else:
|
||||
del self._data[tag]
|
||||
|
||||
def __iter__(self):
|
||||
keys = set(self._data)
|
||||
|
|
Loading…
Reference in New Issue
Block a user