diff --git a/pillow_jxl/JpegXLImagePlugin.py b/pillow_jxl/JpegXLImagePlugin.py index b52b87d..1082800 100644 --- a/pillow_jxl/JpegXLImagePlugin.py +++ b/pillow_jxl/JpegXLImagePlugin.py @@ -33,9 +33,13 @@ def _open(self): if self.jpeg: with Image.open(BytesIO(self._data)) as im: self._data = im.tobytes() - self._size = (self._jxlinfo.width, self._jxlinfo.height) - self.rawmode = self._jxlinfo.mode - self.info["icc_profile"] = icc_profile + self._size = im.size + self.rawmode = im.mode + self.info = im.info + else: + self._size = (self._jxlinfo.width, self._jxlinfo.height) + self.rawmode = self._jxlinfo.mode + self.info["icc_profile"] = icc_profile # NOTE (Isotr0py): PIL 10.1.0 changed the mode to property, use _mode instead if parse(PIL.__version__) >= parse("10.1.0"): self._mode = self.rawmode