the underlying cause of getting the error message of Reason: "broken data stream when reading image file"

wine lover winecoding at gmail.com
Wed Jul 27 22:59:58 EDT 2016


Hi, 

I am trying to test the skimage by running the following python script

from skimage import io
data = io.imread("./test_data/tiger.jpeg")print(data.shape)


It gives the following error messages. What can be the reason? Thank you 
very much for the help.


bash-4.1$ python test.py

Traceback (most recent call last): File 
"/test/tfw/lib/python3.4/site-packages/scikit_image-0.12.3-py3.4-linux-x86_64.egg/skimage/io/_plugins/pil_plugin.py", 
line 53, in pil_to_ndarray im.getdata()[0] File 
"/test/tfw/lib/python3.4/site-packages/Pillow-3.2.0-py3.4-linux-x86_64.egg/PIL/Image.py", 
line 1151, in getdata File 
"/test/tfw/lib/python3.4/site-packages/Pillow-3.2.0-py3.4-linux-x86_64.egg/PIL/ImageFile.py", 
line 235, in load File 
"/test/tfw/lib/python3.4/site-packages/Pillow-3.2.0-py3.4-linux-x86_64.egg/PIL/ImageFile.py", 
line 59, in raise_ioerror OSError: broken data stream when reading image 
file

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "test.py", line 2, in data = 
io.imread("./test_data/tiger.jpeg") File 
"/test/tfw/lib/python3.4/site-packages/scikit_image-0.12.3-py3.4-linux-x86_64.egg/skimage/io/_io.py", 
line 61, in imread img = call_plugin('imread', fname, plugin=plugin, 
**plugin_args) File 
"/test/tfw/lib/python3.4/site-packages/scikit_image-0.12.3-py3.4-linux-x86_64.egg/skimage/io/manage_plugins.py", 
line 211, in call_plugin return func(*args, **kwargs) File 
"/test/tfw/lib/python3.4/site-packages/scikit_image-0.12.3-py3.4-linux-x86_64.egg/skimage/io/_plugins/pil_plugin.py", 
line 37, in imread return pil_to_ndarray(im, dtype=dtype, img_num=img_num) 
File 
"/test/tfw/lib/python3.4/site-packages/scikit_image-0.12.3-py3.4-linux-x86_64.egg/skimage/io/_plugins/pil_plugin.py", 
line 61, in pil_to_ndarray raise ValueError(error_message) ValueError: 
Could not load "" Reason: "broken data stream when reading image file" 
Please see documentation at:
http://pillow.readthedocs.org/en/latest/installation.html#external-libraries
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20160727/14c5a539/attachment.html>


More information about the scikit-image mailing list