when compiling Pillow with libtiff and libjpeg (with jpeg12 enabled -
which is the default with libjpeg-3.0.0) the libtiff object
tif_jpeg_12.c.o uses the following libjpeg12 functions:
jpeg12_read_raw_data, jpeg12_read_scanlines, jpeg12_write_raw_data,
jpeg12_write_scanlines.
update the ordering of libs.append(feature.tiff) to be before
libs.append(feature.jpeg) to allow the linker to include the required
functions.
this issue occurs when the libtiff and libjpeg libraries are static
(not shared.)
Signed-off-by: Rudi Heitbaum <rudi@heitbaum.com>
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
tp_print was renamed to tp_vectorcall_offset with Python 3.8, and tp_compare was renamed to tp_as_async with Python 3.5.
tp_size has always been tp_basicsize; I don't know why that one was wrong.
Remove the redundant `wheel` dependency, as it is added by the backend
automatically. Listing it explicitly in the documentation was
a historical mistake and has been fixed since, see:
f7d30a9529
While Pillow uses a custom backend that modifies the `bdist_wheel`
method, it does not import `wheel` or use it in a way that would rely
on setuptools implementation details.