Skip to content

Commit

Permalink
use the mode from the reconstructed jpeg
Browse files Browse the repository at this point in the history
  • Loading branch information
Piezoid committed Oct 6, 2024
1 parent 4d64d77 commit d6b1ad9
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions pillow_jxl/JpegXLImagePlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d6b1ad9

Please sign in to comment.