mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 18:56:17 +03:00
When IFD is missing, connect get_ifd() dictionary to Exif
This commit is contained in:
parent
6a9acfa5ca
commit
42bfcaa2d4
|
@ -769,6 +769,14 @@ class TestImage:
|
|||
exif.load(b"Exif\x00\x00")
|
||||
assert not dict(exif)
|
||||
|
||||
def test_empty_get_ifd(self) -> None:
|
||||
exif = Image.Exif()
|
||||
ifd = exif.get_ifd(0x8769)
|
||||
assert ifd == {}
|
||||
|
||||
ifd[36864] = b"0220"
|
||||
assert exif.get_ifd(0x8769) == {36864: b"0220"}
|
||||
|
||||
@mark_if_feature_version(
|
||||
pytest.mark.valgrind_known_error, "libjpeg_turbo", "2.0", reason="Known Failing"
|
||||
)
|
||||
|
|
|
@ -4073,7 +4073,7 @@ class Exif(_ExifBase):
|
|||
else:
|
||||
# Interop
|
||||
self._ifds[tag] = self._get_ifd_dict(tag_data, tag)
|
||||
ifd = self._ifds.get(tag, {})
|
||||
ifd = self._ifds.setdefault(tag, {})
|
||||
if tag == ExifTags.IFD.Exif and self._hidden_data:
|
||||
ifd = {
|
||||
k: v
|
||||
|
|
Loading…
Reference in New Issue
Block a user