Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when loading image #2955

Closed
matthiasbeyer opened this issue Jan 12, 2018 · 17 comments
Closed

Error when loading image #2955

matthiasbeyer opened this issue Jan 12, 2018 · 17 comments
Labels
Awaiting OP Action Bug Any unexpected behavior, until confirmed feature.
Milestone

Comments

@matthiasbeyer
Copy link

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'
@wiredfool
Copy link
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.

@hugovk
Copy link
Member

hugovk commented Jan 12, 2018

See #1888.

@matthiasbeyer
Copy link
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).

@wiredfool
Copy link
Member

Can you post that one?

@matthiasbeyer
Copy link
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.

@wiredfool
Copy link
Member

Both of those worked for me.

@matthiasbeyer
Copy link
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!

@matthiasbeyer
Copy link
Author

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

@matthiasbeyer
Copy link
Author

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

@matthiasbeyer
Copy link
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.

@matthiasbeyer
Copy link
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.

@wiredfool
Copy link
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.

@matthiasbeyer
Copy link
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).

@wiredfool
Copy link
Member

@aclark4life
Copy link
Member

@matthiasbeyer Still an issue?

@aclark4life aclark4life added the Bug Any unexpected behavior, until confirmed feature. label Apr 1, 2018
@aclark4life aclark4life added this to the Future milestone Apr 1, 2018
@radarhere
Copy link
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?

@radarhere
Copy link
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
Labels
Awaiting OP Action Bug Any unexpected behavior, until confirmed feature.
Projects
None yet
Development

No branches or pull requests

5 participants