Skip to content

Conversation

@radarhere
Copy link
Member

If an error is raised when converting an image to a NumPy array, NumPy < 1.23 doesn't raise an error. So #6594 added a warning for that scenario.

Pillow/src/PIL/Image.py

Lines 742 to 743 in d6cfebd

if parse_version(numpy.__version__) < parse_version("1.23"):
warnings.warn(str(e))

NumPy < 1.23 is EOL, so this explicit warning can be removed.

A caveat to this is that Ubuntu 22.04 still has NumPy 1.21 packaged. However, that version carries its own warning - https://github.com/python-pillow/Pillow/actions/runs/10500106794/job/29087976733#step:6:5394

/Pillow/Tests/test_image_array.py:51: DeprecationWarning: An exception was ignored while fetching the attribute __array_interface__ from an object of type 'JpegImageFile'. With the exception of AttributeError NumPy will always raise this exception in the future. Raise this deprecation warning to see the original exception. (Warning added NumPy 1.21)

So it is also ok for our custom warning to be removed for that scenario.

@hugovk hugovk merged commit f15034c into python-pillow:main Aug 24, 2024
@radarhere radarhere deleted the numpy branch August 24, 2024 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants