2021-07-06 17:03:45 +03:00
|
|
|
8.3.1
|
|
|
|
-----
|
|
|
|
|
|
|
|
Fixed regression converting to NumPy arrays
|
2024-03-15 03:21:00 +03:00
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2021-07-06 17:03:45 +03:00
|
|
|
|
|
|
|
This fixes a regression introduced in 8.3.0 when converting an image to a NumPy array
|
|
|
|
with a ``dtype`` argument.
|
|
|
|
|
|
|
|
.. code-block:: pycon
|
|
|
|
|
|
|
|
>>> from PIL import Image
|
|
|
|
>>> import numpy
|
|
|
|
>>> im = Image.new("RGB", (100, 100))
|
|
|
|
>>> numpy.array(im, dtype=numpy.float64)
|
|
|
|
Traceback (most recent call last):
|
|
|
|
File "<stdin>", line 1, in <module>
|
|
|
|
TypeError: __array__() takes 1 positional argument but 2 were given
|
|
|
|
>>>
|
|
|
|
|
|
|
|
Catch OSError when checking if destination is sys.stdout
|
2024-03-15 03:50:17 +03:00
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2021-07-06 17:03:45 +03:00
|
|
|
|
|
|
|
In 8.3.0, a check to see if the destination was ``sys.stdout`` when saving an image was
|
2023-11-05 04:18:38 +03:00
|
|
|
updated. This lead to an :py:exc:`OSError` being raised if the environment restricted
|
|
|
|
access.
|
2021-07-06 17:03:45 +03:00
|
|
|
|
2023-11-05 04:18:38 +03:00
|
|
|
The :py:exc:`OSError` is now silently caught.
|
2021-07-06 17:03:45 +03:00
|
|
|
|
|
|
|
Fixed removing orientation in ImageOps.exif_transpose
|
2024-03-15 03:21:00 +03:00
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2021-07-06 17:03:45 +03:00
|
|
|
|
|
|
|
In 8.3.0, :py:meth:`~PIL.ImageOps.exif_transpose` was changed to ensure that the
|
|
|
|
original image EXIF data was not modified, and the orientation was only removed from
|
|
|
|
the modified copy.
|
|
|
|
|
|
|
|
However, for certain images the orientation was already missing from the modified
|
2023-11-05 04:18:38 +03:00
|
|
|
image, leading to a :py:exc:`KeyError`.
|
2021-07-06 17:03:45 +03:00
|
|
|
|
|
|
|
This error has been resolved, and the copying of metadata to the modified image
|
|
|
|
improved.
|