Skip to content

Error when loading image #2955

Description

@matthiasbeyer

What did you do?

Using sigal to build a gallery. sigal uses Pillow in version 4.3.0, though I build it with 5.0.0 as well and it did not work out (see full history of my issue there).

What did you expect to happen?

No error...

What actually happened?

See here. For the lazy:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/nix/store/kl0wavrf8a2syn3cfa33hl0b03yyvx80-python-2.7.14-env/lib/python2.7/site-packages/PIL/Image.py", line 2572, in open
    % (filename if filename else fp))
IOError: cannot identify image file './P1010375.png'

What versions of Pillow and Python are you using?

an image that demonstrates the issue.

p1010375-small

(Image was resized from ~85MB size)

The code below was executed with pillow 4.3.0 - the same error was produced with 5.0.0, though:

>>> import PIL
>>> from PIL import Image
>>> Image.open('./P1010375.png')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/nix/store/kl0wavrf8a2syn3cfa33hl0b03yyvx80-python-2.7.14-env/lib/python2.7/site-packages/PIL/Image.py", line 2572, in open
    % (filename if filename else fp))
IOError: cannot identify image file './P1010375.png'

Activity

  1. wiredfool commented on Jan 12, 2018

    @wiredfool
    Member

    That's a 16 bit per channel RGB image, and Pillow doesn't support multi channel images with more than 8 bpc. It's a longstanding issue.

  2. hugovk commented on Jan 12, 2018

    @hugovk
    Member

    See #1888.

  3. matthiasbeyer commented on Jan 12, 2018

    @matthiasbeyer
    Author

    Thanks for the quick reply.

    I just exported the image from darktable again with 8 bit (adobe pdf) and with 8 bit sRGB... same issue, though (or I did something terribly wrong).

  4. wiredfool commented on Jan 12, 2018

    @wiredfool
    Member

    Can you post that one?

  5. matthiasbeyer commented on Jan 12, 2018

    @matthiasbeyer
    Author

    p1010375_01-small

    and

    p1010375_02-small

    Both resized because of upload limit, using convert P1010375_02.png -resize 25% P1010375_02-small.png.

  6. wiredfool commented on Jan 12, 2018

    @wiredfool
    Member

    Both of those worked for me.

  7. matthiasbeyer commented on Jan 12, 2018

    @matthiasbeyer
    Author

    Fun times. I have to hit the road now, I will reconfirm this when back home (probably Sunday) thanks for your time and support!

  8. matthiasbeyer commented on Feb 22, 2018

    @matthiasbeyer
    Author

    Hi. This issue still exists. What can we do?

  9. matthiasbeyer commented on Feb 22, 2018

    @matthiasbeyer
    Author

    Fun fact: I just checked old pictures I already processed with sigal and they are adobe RGB 16 bit ... and they worked!

  10. matthiasbeyer commented on Feb 22, 2018

    @matthiasbeyer
    Author

    I tried the following: Exported an images as Adobe RGB and sRGB in both 8 bit and 16 bit (so 4 images). None was recognized.

    Using sigal 1.3.0.

  11. matthiasbeyer commented on Feb 22, 2018

    @matthiasbeyer
    Author

    For example, this 16 bit Adobe RGB file gets recognized:

    ( resized because of upload limit, using convert ... -resize 25% ...)

    p1020317_small

    But others do not.

  12. wiredfool commented on Feb 24, 2018

    @wiredfool
    Member

    There's a recently added mode for PNG and TIFF that's a truncated RGB;16B mode, where it returns an 8 bit/channel image from a 16bit original.

  13. matthiasbeyer commented on Feb 25, 2018

    @matthiasbeyer
    Author

    How recent is it? Is it in the 5.0.0 release? Because that's what sigal uses on my machine (nixpkgs packaged sigal with pillow 5.0.0).

  14. aclark4life commented on Apr 1, 2018

    @aclark4life
    Member

    @matthiasbeyer Still an issue?

  15. added
    BugAny unexpected behavior, until confirmed feature.
    on Apr 1, 2018
  16. added this to the Future milestone on Apr 1, 2018
  17. radarhere commented on Oct 28, 2018

    @radarhere
    Member

    I can open and load all of the attached images with Pillow 4.3.0 with Python 2.7 on macOS 10.14. @matthiasbeyer what operating system are you using?

  18. radarhere commented on Dec 24, 2018

    @radarhere
    Member

    Closing, as I am unable to reproduce, and due to lack of response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Awaiting OP ActionBugAny unexpected behavior, until confirmed feature.PNG

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions