We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib/matplotlib/tests/test_png.py:19: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ lib/matplotlib/pyplot.py:2378: in imread return matplotlib.image.imread(fname, format) lib/matplotlib/image.py:1544: in imread if isinstance(image, PIL.PngImagePlugin.PngImageFile) else _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ pil_png = <PIL.PngImagePlugin.PngImageFile image mode=1 size=32x32 at 0x7F4A53D83910> def _pil_png_to_float_array(pil_png): """Convert a PIL `PNGImageFile` to a 0-1 float array.""" # Unlike pil_to_array this converts to 0-1 float32s for backcompat with the # old libpng-based loader. # The supported rawmodes are from PIL.PngImagePlugin._MODES. When # mode == "RGB(A)", the 16-bit raw data has already been coarsened to 8-bit # by Pillow. mode = pil_png.mode rawmode = pil_png.png.im_rawmode if rawmode == "1": # Grayscale. > return np.asarray(pil_png, np.float32) E TypeError: __array__() takes 1 positional argument but 2 were given
The text was updated successfully, but these errors were encountered:
This has been reported in pillow as python-pillow/Pillow#5571.
As a temporary workaround, you can separate the conversion to numpy array and changing dtype, i.e. from
return np.asarray(pil_png, np.float32)
to
return np.asarray(pil_png).astype(np.float32)
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
The text was updated successfully, but these errors were encountered: