mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 09:56:17 +03:00
Python Imaging Library (Fork)
6d440ac995
In 10.0.0 a _repr_jpeg_ implementation was added to the Image object to enable the use of display_jpeg() in IPython environments. However, in some cases the implementation of this method could result in an exception being raised while trying to generate the jpeg data. The best example is if the image data is in an RGBA format as a result of the object being created by opening a PNG file. In this case trying to save the Image object as a jpeg will error because the jpeg format can't represent the transparency in the alpha channel. This results in an exception being raised in the IPython/Jupyter context when outputing the image object. However, in cases like this IPython allows the repr methods to return None to indicate there is no representation in that format available. [1] This commit updates the _repr_png_ and _repr_jpeg_ methods to catch any exception that might be raised while trying to generate the image data. If an exception is raised we treat that as not being able to generate image data in that format and return None instead. Related to #7259 [1] https://ipython.readthedocs.io/en/stable/config/integrating.html#custom-methods |
||
---|---|---|
_custom_build | ||
.ci | ||
.github | ||
depends | ||
docs | ||
src | ||
Tests | ||
winbuild | ||
.appveyor.yml | ||
.clang-format | ||
.coveragerc | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.pre-commit-config.yaml | ||
.readthedocs.yml | ||
CHANGES.rst | ||
codecov.yml | ||
conftest.py | ||
LICENSE | ||
Makefile | ||
MANIFEST.in | ||
pyproject.toml | ||
README.md | ||
RELEASING.md | ||
selftest.py | ||
setup.cfg | ||
setup.py | ||
tox.ini |
Pillow
Python Imaging Library (Fork)
Pillow is the friendly PIL fork by Jeffrey A. Clark (Alex) and contributors. PIL is the Python Imaging Library by Fredrik Lundh and Contributors. As of 2019, Pillow development is supported by Tidelift.
docs | |
---|---|
tests | |
package | |
social |
Overview
The Python Imaging Library adds image processing capabilities to your Python interpreter.
This library provides extensive file format support, an efficient internal representation, and fairly powerful image processing capabilities.
The core image library is designed for fast access to data stored in a few basic pixel formats. It should provide a solid foundation for a general image processing tool.
More Information
Report a Vulnerability
To report a security vulnerability, please follow the procedure described in the Tidelift security policy.