-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Attached PNG loads as solid-black square #666
Comments
It's not picking up the transparency or alpha channel, with debugging on:
Imagemagick is picking up the correct values, but I'm seeing conflicting info for the alpha channel. Going to have to dig a bit further into the image to see what the unknown chunk is. |
Looks like we don't properly convert the color type: http://www.libpng.org/pub/png/spec/1.2/PNG-Chunks.html#C.IHDR For the unknown chunk, there are 8 bytes of data following the SRGB chunk which are not supposed to be there: http://www.libpng.org/pub/png/spec/1.2/PNG-Chunks.html#C.sRGB |
Is there a specific reason for Pillow not using libpng? Note that this is not the only PNG related problem. More than 1 bit of transparency in indexed PNG images also fail to read and write (PIL/low is actually the only imaging library I've ever encountered that even fails reading them!), sRGB and UTF-8 text chunks (iTXt) are not supported, etc. etc. Code quality is also questionable, with gems such as if transparency or transparency == 0: instead of if transparency != None: and variable naming conventions that use |
Pillow is still full of old junk but steadily improving. We just revived it.
Is there for a reason, it does prevent empty lists and bytes.
Would cause bugs, you would have to check
I don't know why Pillow just uses zlib and not libpng to reduce some hassle. @CounterPillow do you have time to implement it? |
@CounterPillow please provide an example for
|
Apologies, I have just noticed that the palette problems seem to have recently been fixed (#544 I think). However, the point I was trying to make with my comment is that using libpng is probably the less painful option in the long run. |
I think most of us can agree with that, but it is still going to be a lot of work somebody would have to do to implement it initially. |
Closing this as there's been no updates in 5 years. PRs are welcome to improve library support. |
With this PNG file...
...this code displays a black square:
...as a result, this code which depends on Pillow also produces a black square:
I almost filed a bug with python-escpos because Pillow failed silently rather than either working or raising an exception.
The text was updated successfully, but these errors were encountered: