Skip to content

IOError: cannot identify image file '/path/to/Sample.tiff' with unknown Exif Tag #3372

@ttback

Description

@ttback

What did you do?

I try to Image.open(tiff_path) on a 8-bit tiff image and got an error.

What did you expect to happen?

Image.open() is supposed to work on a 8-bit tiff image.

What actually happened?

Error from Pillow

  File "test.py", line 3, in <module>
    page=Image.open(path)
  File "/tmp/tiff/venv/local/lib/python2.7/site-packages/PIL/Image.py", line 2622, in open
    % (filename if filename else fp))
IOError: cannot identify image file '/path/to/Sample.tiff'

What are your OS, Python and Pillow versions?

  • OS: Debian 6.0
  • Python: Python 2.7
  • Pillow: Tried both legacy 2.9.0 and 5.2.0
from PIL import Image
path = "/Image/Sample.tiff"
page=Image.open(path)

The images are not public so I can't share them. But here are some imagemagick identify that may help.

Image that caused the error
Original image:

TIFF 3426x4378 3426x4378+0+0 1-bit Bilevel Gray 578044B 0.010u 0:00.009
unknown field with tag 32934 (0x80a6) encountered. `TIFFReadDirectory' @ warning/tiff.c/TIFFWarnings/704.

Processed image(resized without -strip)
TIFF 6669x6812 6669x6812+0+0 8-bit DirectClass 3.738MB 0.000u 0:00.000
A working image:
TIFF 5945x7399 5945x7399+0+0 8-bit DirectClass 4.952MB 0.000u 0:00.000

If there is any way to fix this image for Pillow loading, it would help as well.
Should unknown field with tag cause Pillow tiff loading issue?

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