File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -775,6 +775,14 @@ def test_empty_exif(self) -> None:
775775 exif .load (b"Exif\x00 \x00 " )
776776 assert not dict (exif )
777777
778+ def test_duplicate_exif_header (self ) -> None :
779+ with Image .open ("Tests/images/exif.png" ) as im :
780+ im .load ()
781+ im .info ["exif" ] = b"Exif\x00 \x00 " + im .info ["exif" ]
782+
783+ exif = im .getexif ()
784+ assert exif [274 ] == 1
785+
778786 def test_empty_get_ifd (self ) -> None :
779787 exif = Image .Exif ()
780788 ifd = exif .get_ifd (0x8769 )
Original file line number Diff line number Diff line change @@ -3968,7 +3968,7 @@ def load(self, data: bytes) -> None:
39683968 self ._data .clear ()
39693969 self ._hidden_data .clear ()
39703970 self ._ifds .clear ()
3971- if data and data .startswith (b"Exif\x00 \x00 " ):
3971+ while data and data .startswith (b"Exif\x00 \x00 " ):
39723972 data = data [6 :]
39733973 if not data :
39743974 self ._info = None
You can’t perform that action at this time.
0 commit comments