diff --git a/Tests/test_file_jxl_metadata.py b/Tests/test_file_jxl_metadata.py index 8fc540642..b1bcf6e79 100644 --- a/Tests/test_file_jxl_metadata.py +++ b/Tests/test_file_jxl_metadata.py @@ -35,7 +35,7 @@ def test_read_exif_metadata() -> None: exif_data = image.info.get("exif", None) assert exif_data - exif = image._getexif() + exif = image.getexif() # Camera make assert exif[271] == "Canon" @@ -123,4 +123,4 @@ def test_4_byte_exif(monkeypatch: pytest.MonkeyPatch) -> None: def test_read_exif_metadata_empty() -> None: with Image.open("Tests/images/hopper.jxl") as image: - assert image._getexif() is None + assert image.getexif() == {} diff --git a/src/PIL/JpegXlImagePlugin.py b/src/PIL/JpegXlImagePlugin.py index 0a8c415b6..d3192d0bd 100644 --- a/src/PIL/JpegXlImagePlugin.py +++ b/src/PIL/JpegXlImagePlugin.py @@ -2,7 +2,6 @@ from __future__ import annotations import struct from io import BytesIO -from typing import Any from . import Image, ImageFile @@ -77,11 +76,6 @@ class JpegXlImageFile(ImageFile.ImageFile): self._rewind() - def _getexif(self) -> dict[int, Any] | None: - if "exif" not in self.info: - return None - return self.getexif()._get_merged_dict() - def _get_next(self) -> tuple[bytes, float, float, bool]: # Get next frame