mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-04 11:53:32 +03:00
Merge pull request #8230 from radarhere/exif_get_ifd
This commit is contained in:
commit
e2c13571c3
|
@ -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_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(
|
@mark_if_feature_version(
|
||||||
pytest.mark.valgrind_known_error, "libjpeg_turbo", "2.0", reason="Known Failing"
|
pytest.mark.valgrind_known_error, "libjpeg_turbo", "2.0", reason="Known Failing"
|
||||||
)
|
)
|
||||||
|
|
|
@ -4136,7 +4136,7 @@ class Exif(_ExifBase):
|
||||||
ifd = self._get_ifd_dict(tag_data, tag)
|
ifd = self._get_ifd_dict(tag_data, tag)
|
||||||
if ifd is not None:
|
if ifd is not None:
|
||||||
self._ifds[tag] = ifd
|
self._ifds[tag] = ifd
|
||||||
ifd = self._ifds.get(tag, {})
|
ifd = self._ifds.setdefault(tag, {})
|
||||||
if tag == ExifTags.IFD.Exif and self._hidden_data:
|
if tag == ExifTags.IFD.Exif and self._hidden_data:
|
||||||
ifd = {
|
ifd = {
|
||||||
k: v
|
k: v
|
||||||
|
|
Loading…
Reference in New Issue
Block a user