mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 18:26:17 +03:00
Keep new IFDs when converting EXIF to bytes
This commit is contained in:
parent
1a79d1025c
commit
9368a86397
|
@ -793,6 +793,10 @@ class TestImage:
|
|||
ifd[36864] = b"0220"
|
||||
assert exif.get_ifd(0x8769) == {36864: b"0220"}
|
||||
|
||||
reloaded_exif = Image.Exif()
|
||||
reloaded_exif.load(exif.tobytes())
|
||||
assert reloaded_exif.get_ifd(0x8769) == {36864: b"0220"}
|
||||
|
||||
@mark_if_feature_version(
|
||||
pytest.mark.valgrind_known_error, "libjpeg_turbo", "2.0", reason="Known Failing"
|
||||
)
|
||||
|
|
|
@ -4023,6 +4023,9 @@ class Exif(_ExifBase):
|
|||
|
||||
head = self._get_head()
|
||||
ifd = TiffImagePlugin.ImageFileDirectory_v2(ifh=head)
|
||||
for tag, ifd_dict in self._ifds.items():
|
||||
if tag not in self:
|
||||
ifd[tag] = ifd_dict
|
||||
for tag, value in self.items():
|
||||
if tag in [
|
||||
ExifTags.IFD.Exif,
|
||||
|
|
Loading…
Reference in New Issue
Block a user