You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am brand new with imageio. It looks like np.stack() is throwing
ValueError('all input arrays must have the same shape')
when reading a .gif file via HTTPS from a URL. I tried two different image files with the same result.
I'd appreciate any ideas or insights into the issue.
importimageio.v3asiioimportio# from HTTPSweb_image="https://upload.wikimedia.org/wikipedia/commons/d/d3/Newtons_cradle_animation_book_2.gif"# web_image = "https://media.giphy.com/media/BPJmthQ3YRwD6QqcVD/giphy.gif"frames=iio.imread(web_image, index=None)
Traceback (most recent call last):
File "/Users/martinmeo/SW_DEV/PYTHON/2023/IMAGE-IO-LIB/demo.py", line 7, in
frames = iio.imread(web_image, index=None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/martinmeo/miniconda3/envs/PATH311/lib/python3.11/site-packages/imageio/v3.py", line 54, in imread
return np.asarray(img_file.read(**call_kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/martinmeo/miniconda3/envs/PATH311/lib/python3.11/site-packages/imageio/plugins/pillow.py", line 234, in read
image = np.stack([im for im in iterator], axis=0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<array_function internals>", line 200, in stack
File "/Users/martinmeo/miniconda3/envs/PATH311/lib/python3.11/site-packages/numpy/core/shape_base.py", line 464, in stack
raise ValueError('all input arrays must have the same shape')
ValueError: all input arrays must have the same shape
The GIF cannot be read properly as the first frame has a different dimension to the others, therefore numpy unable to stack the frames with different shape:
Hey folks,
I am brand new with imageio. It looks like np.stack() is throwing
ValueError('all input arrays must have the same shape')
when reading a .gif file via HTTPS from a URL. I tried two different image files with the same result.
The code is directly from documentation examples so why doesn't everyone get this error on day one.
examples reading-from-fancy-sources
I'd appreciate any ideas or insights into the issue.
HW: MacBook Pro M2
OS: macOS Ventura 13.4.1 (c)
conda 23.3.1
python: 3.11.3
imageio: 2.31.1
The text was updated successfully, but these errors were encountered: