It makes sense to treat it as an error but the ISO standard is too vague on this and the libpng developers never "fixed" this[1], it issues a warning but otherwise just masks off the high bits. Firefox has a workaround[2][3], Chrome doesn't.
FWIW I do the same in my library[4], handling it as an error is problematic because it would mean the chunk gets discarded and then you can't even retrieve the values.
FWIW I do the same in my library[4], handling it as an error is problematic because it would mean the chunk gets discarded and then you can't even retrieve the values.
[1] https://sourceforge.net/p/png-mng/mailman/png-mng-implement/...
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=428045
[3] https://searchfox.org/mozilla-central/source/image/decoders/...
[4] https://libspng.org/