py3-pillow doesn’t support jpeg2000
Hello!
It seems that py3-pillow is built with jpeg2000 support, according to the build logs.
But when testing with this small python script:
from PIL import Image
i = Image.open('/lol.jpg')
i.save('/tmp/lol.jp2k', format='JPEG2000')
I got this trace:
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/PIL/Image.py", line 476, in _getencoder
encoder = getattr(core, encoder_name + "_encoder")
AttributeError: module 'PIL._imaging' has no attribute 'jpeg2k_encoder'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.8/site-packages/PIL/Image.py", line 2084, in save
save_handler(self, fp, filename)
File "/usr/lib/python3.8/site-packages/PIL/Jpeg2KImagePlugin.py", line 294, in _save
ImageFile._save(im, fp, [("jpeg2k", (0, 0) + im.size, 0, kind)])
File "/usr/lib/python3.8/site-packages/PIL/ImageFile.py", line 522, in _save
e = Image._getencoder(im.mode, e, a, im.encoderconfig)
File "/usr/lib/python3.8/site-packages/PIL/Image.py", line 479, in _getencoder
raise IOError("encoder %s not available" % encoder_name)
OSError: encoder jpeg2k not available
I used the docker image alpine:latest (3.14), and installed py3-pillow and python3.