This code expects that PLTE chunk is present only for Color type = 3 (Paletted). If it is present for other types, the mentioned error is thrown.
According to PNG specification, PLTE chunk may appear also for types 2 or 6. The PNG file linked above is type 2 and contains PLTE chunk, so it is compliant with PNG specs.
The text was updated successfully, but these errors were encountered:
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Try to decode e.g. this file with png.Decode().
What did you expect to see?
No error and decoded image.
What did you see instead?
invalid format: chunk out of order
What I think is the cause
It looks like the problem is here.
This code expects that PLTE chunk is present only for Color type = 3 (Paletted). If it is present for other types, the mentioned error is thrown.
According to PNG specification, PLTE chunk may appear also for types 2 or 6. The PNG file linked above is type 2 and contains PLTE chunk, so it is compliant with PNG specs.
The text was updated successfully, but these errors were encountered: