-
Notifications
You must be signed in to change notification settings - Fork 145
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
Feature request: parsing sBIT
chunks
#519
Comments
Would this interface work?
|
That interface seems fine to me, but I'd also be OK with something simpler like just having a (If the sBIT chunk itself is invalid, the field would be left as |
BTW the implementation you've linked to checks for 565 depth exactly, instead of <=5 <=6 <=5 so it will miss out on optimizing for 555 and lower depths. However, in practice I don't think there are any PNGs using sBIT on the Web. |
Is anyone currently working on this issue? If not, may I take it on to fix? |
@thirumurugan-git nobody is currently working on this, so please feel free to open a PR. |
Fixed by #524 |
The PNG spec describes an
sBIT
chunk, but AFAICT thepng
crate ignores this kind of chunks today. Chromium/Blink integration doesn't have a hard dependency on support forsBIT
chunks, but it would help for fully matching the behavior of legacy decoders - see https://crbug.com/359279096 for more details.I think that adding
sBIT
support would involve something like:sBIT
information through theInfo
struct (this is a bit tricky, because depending on the color type, only bitness of some channels may be provided in thesBIT
chunk). Once this is done, then add representation of the chunk to theInfo
struct insrc/common.rs
sBIT
-specific definitions tosrc/chunk.rs
and addfn parse_sbit
tosrc/decoder/stream.rs
(calling it fromfn parse_chunk
)The text was updated successfully, but these errors were encountered: