From a8bd8e99e2c3b4d3a9b34fcb638d1f86768c034e Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 24 Dec 2024 11:59:12 +1100 Subject: [PATCH] Test saving EXIF instance without orientation --- Tests/test_file_avif.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Tests/test_file_avif.py b/Tests/test_file_avif.py index 530305a978f..d756fd82f0a 100644 --- a/Tests/test_file_avif.py +++ b/Tests/test_file_avif.py @@ -349,6 +349,18 @@ def test_exif_save( else: assert reloaded.info["exif"] == exif_data + def test_exif_without_orientation(self, tmp_path: Path): + exif = Image.Exif() + exif[272] = b"test" + exif_data = exif.tobytes() + with Image.open(TEST_AVIF_FILE) as im: + test_file = str(tmp_path / "temp.avif") + im.save(test_file, exif=exif) + + with Image.open(test_file) as reloaded: + assert reloaded.info["exif"] == exif_data + + def test_exif_invalid(self, tmp_path: Path) -> None: with Image.open(TEST_AVIF_FILE) as im: test_file = str(tmp_path / "temp.avif")