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

Stéfan van der Walt stefanv at berkeley.edu
Thu Jul 28 04:27:01 EDT 2016


Hi,

It sounds like the image might be corrupt. Can you load it using other
image viewers? Also, did you try different plugins?

Stéfan

On Jul 27, 2016 20:00, "wine lover" <winecoding at gmail.com> wrote:

> 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
>
> --
> You received this message because you are subscribed to the Google Groups
> "scikit-image" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to scikit-image+unsubscribe at googlegroups.com.
> To post to this group, send email to scikit-image at googlegroups.com.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/scikit-image/fe62dc05-e818-4352-a236-3fb10593bc1a%40googlegroups.com
> <https://groups.google.com/d/msgid/scikit-image/fe62dc05-e818-4352-a236-3fb10593bc1a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20160728/17124400/attachment.html>


More information about the scikit-image mailing list