Skip to content

OSError: -2 when decoding a tiff_lzw file #4237

@kmilos

Description

@kmilos

This is with pillow 6.2.1 on

Python 3.7.3 | packaged by conda-forge | (default, Jul 1 2019, 22:01:29) [MSC v.1900 64 bit (AMD64)]

Seems libtiff is found without a problem, but decoding fails:

In [5]: dat = img.getdata()
have fileno, calling fileno version of the decoder.
Traceback (most recent call last):

  File "<ipython-input-5-d82315236633>", line 1, in <module>
    dat = img.getdata()

  File "C:\Users\kmilos\.conda\envs\dev\lib\site-packages\PIL\Image.py", line 1304, in getdata
    self.load()

  File "C:\Users\kmilos\.conda\envs\dev\lib\site-packages\PIL\TiffImagePlugin.py", line 1097, in load
    return self._load_libtiff()

  File "C:\Users\kmilos\.conda\envs\dev\lib\site-packages\PIL\TiffImagePlugin.py", line 1209, in _load_libtiff
    raise IOError(err)

OSError: -2


In [6]: dat = img.getdata()

In [7]: print(dat)
<ImagingCore object at 0x000001FC04A55DB0>

Also note that on the second attempt I get an object back, bit if I try to convert to an array, it is filled with zeros, so issue #3863 is not really closed for me.

No problems if I use 'TIFF' or 'TIFF-FI' formats via imageio, but 'TIFF-PIL' fails with the same error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions