Skip to content
This repository was archived by the owner on Apr 12, 2023. It is now read-only.

Allow more leniency #101

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Allow more leniency #101

wants to merge 1 commit into from

Conversation

topin89
Copy link

@topin89 topin89 commented Apr 29, 2020

Some images have non-critical errors, like "sBIT" or is too small, having not data for alpha channel or "bKGD" was formed for grayscale, but image itself is in RGBA. Proposed change allows for more leniency so read() function could work on such images.

Some images have non-critical errors, like "sBIT" or is too small, having not data for alpha channel or "bKGD" was formed for grayscale, but image itself is in RGBA. Proposed change allows for more leniency so read() function could work on such images.
@drj11
Copy link
Owner

drj11 commented Jun 9, 2020

Do you have any example images?

@drj11
Copy link
Owner

drj11 commented Jun 9, 2020

This is a bit of a slippery slope issue, and I felt the same when I accepted the original PR to add the lenient flag.

The basic problem is "how lenient should we be?".

What are you trying to do, and what have you had to do instead to workaround the problem?

@drj11
Copy link
Owner

drj11 commented Apr 24, 2021

(Mostly notes for my future self)

A possible principle that could be adopted:

  • we could be lenient where it does not affect PyPNG's understanding of the PNG file itself.

Under this principle, we could be lenient with a bKGD chunk, because PyPNG doesn't really process it, it just reports it. We could not be lenient with tRNS chunk because PyPNG processes that to create and alpha channel.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants