Closed paolobenve closed 5 months ago
I can't reproduce this with test/images/sample.jpg
using latest release version:
img_ori = Image.open("test/images/sample.jpg")
img_ori.save(temp, quality=98)
Can you provide more details about the image and using version?
ok, I revised better my code, it's different:
File "/home/paolo/git/myphotoshare/scanner/PhotoAlbum.py", line 5299, in save_image
image.save("prova.jxl", quality=50, exif=None)
File "/usr/lib/python3/dist-packages/PIL/Image.py", line 2439, in save
save_handler(self, fp, filename)
File "/home/paolo/git/myphotoshare/scanner/venv3.12/lib/python3.12/site-packages/pillow_jxl/JpegXLImagePlugin.py", line 132, in _save
data = enc(
^^^^
pyo3_runtime.PanicException: called `Option::unwrap()` on a `None` value
The culprit seems to be the "exif=None" parameter, removing it solves the crash.
AFAIK, saving with all the other formats accept "exif=None". My code used it without any problem. I'd suggest to manage this case in the plugin, too.
I has released version v1.2.4 to fix this, please feel free to reopen this issue if encountered issue :)
thank you!
In my app using pillow-jxl-plugin:
Actually (and weirdly) the image which triggers the error is a jpg one...