Skip to content

sage containers missing PIL(low) jpeg support #37304

Open
@stdweird

Description

@stdweird

Steps To Reproduce

import PIL.Image
v=PIL.Image.open('sample_640_426.jpeg')
v.convert('L')

you get a backtrace that ends with

...
File /home/sage/sage/local/var/lib/sage/venv-python3.11.1/lib/python3.11/site-packages/PIL/Image.py:393, in _getdecoder(mode, decoder_name, args, extra)
    391 except AttributeError as e:
    392     msg = f"decoder {decoder_name} not available"
--> 393     raise OSError(msg) from e
    394 return decoder(mode, *args + extra)

OSError: decoder jpeg not available

searching about this issue suggests that libjpeg-dev is missing when pillow was being built.

adding libjpeg-dev is not enough, you must recompile PIL

Expected Behavior

that you can use jpeg images with PIL in SAGE

Actual Behavior

stacktrace due to missing OS libraries (at compiler, but ofcourse also at runtime).

Additional Information

I don't know the gitrepo enough to know where all OS dependencies are installed; i assume opening a PR to add it to the main Dockerfile is not an option

Environment

- **OS**: Ubuntu 22.04.3 LTS
- **Sage Version**: 10.2

From the dockerhub container

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions