mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-24 08:14:10 +03:00
Merge pull request #8350 from zakajd/jamil/doubleexif
This commit is contained in:
commit
f06b851616
|
@ -775,6 +775,14 @@ class TestImage:
|
||||||
exif.load(b"Exif\x00\x00")
|
exif.load(b"Exif\x00\x00")
|
||||||
assert not dict(exif)
|
assert not dict(exif)
|
||||||
|
|
||||||
|
def test_duplicate_exif_header(self) -> None:
|
||||||
|
with Image.open("Tests/images/exif.png") as im:
|
||||||
|
im.load()
|
||||||
|
im.info["exif"] = b"Exif\x00\x00" + im.info["exif"]
|
||||||
|
|
||||||
|
exif = im.getexif()
|
||||||
|
assert exif[274] == 1
|
||||||
|
|
||||||
def test_empty_get_ifd(self) -> None:
|
def test_empty_get_ifd(self) -> None:
|
||||||
exif = Image.Exif()
|
exif = Image.Exif()
|
||||||
ifd = exif.get_ifd(0x8769)
|
ifd = exif.get_ifd(0x8769)
|
||||||
|
|
|
@ -3968,7 +3968,7 @@ class Exif(_ExifBase):
|
||||||
self._data.clear()
|
self._data.clear()
|
||||||
self._hidden_data.clear()
|
self._hidden_data.clear()
|
||||||
self._ifds.clear()
|
self._ifds.clear()
|
||||||
if data and data.startswith(b"Exif\x00\x00"):
|
while data and data.startswith(b"Exif\x00\x00"):
|
||||||
data = data[6:]
|
data = data[6:]
|
||||||
if not data:
|
if not data:
|
||||||
self._info = None
|
self._info = None
|
||||||
|
|
Loading…
Reference in New Issue
Block a user