@ctruta, you need to upstream this to @svgeesus The base spec is unambiguous, a critical after IDAT is still an abort for the decoder, however that has always posed the problem that the decoder may well have displayed the whole image already! So the W3C spec needs to regularise the behaviour; for single images it did not matter a damn what was done in the post-IDAT phase but now there are many post-IDAT phases.
In some cases this will damage existing decoders; decoders which delay operations or detectably fail post IDAT will be dinged. So detecting errors becomes not just optional but, in fact, criminal.
PNG is presumptively sequential; the fix (@ProgramMax) is easy. The sequence points are the fcTls; therefore all the rules are suspended after the first correctly formed chunk beyond the last correctly formed IDAT and only resume at each fcTL. The current spec is ambiguous; for a single image no problem (it's a done deal, no errors, no warnings for ever). For APNG fcTL has to behave like IEND (or am I missing something?) All pending issues drop.
The W3C has gone one foot of a mile here; fcTL and fdAT must occur in sequence otherwise there is an error. However this is too tight; rather at each fcTL the required sequence numbers (intervening fdAT) must all be present and, of course, correct.
Warnings and errors must be handled at the end of each pseudo-IDAT segment; the first chunk after IDAT or the next fcTL. There is no reason or cause to handle other errors that occur before IEND; at that point a streaming decoder will have handled all the data it can. Of course a decoder may handle the errors or warnings, but such decoders will soon by abolished by popular approbation or lack thereof.
Originally posted by @jbowler in pnggroup/libpng#903 (comment)
@ctruta, you need to upstream this to @svgeesus The base spec is unambiguous, a critical after IDAT is still an abort for the decoder, however that has always posed the problem that the decoder may well have displayed the whole image already! So the W3C spec needs to regularise the behaviour; for single images it did not matter a damn what was done in the post-IDAT phase but now there are many post-IDAT phases.
In some cases this will damage existing decoders; decoders which delay operations or detectably fail post IDAT will be dinged. So detecting errors becomes not just optional but, in fact, criminal.
PNG is presumptively sequential; the fix (@ProgramMax) is easy. The sequence points are the fcTls; therefore all the rules are suspended after the first correctly formed chunk beyond the last correctly formed IDAT and only resume at each fcTL. The current spec is ambiguous; for a single image no problem (it's a done deal, no errors, no warnings for ever). For APNG fcTL has to behave like IEND (or am I missing something?) All pending issues drop.
The W3C has gone one foot of a mile here; fcTL and fdAT must occur in sequence otherwise there is an error. However this is too tight; rather at each fcTL the required sequence numbers (intervening fdAT) must all be present and, of course, correct.
Warnings and errors must be handled at the end of each pseudo-IDAT segment; the first chunk after IDAT or the next fcTL. There is no reason or cause to handle other errors that occur before IEND; at that point a streaming decoder will have handled all the data it can. Of course a decoder may handle the errors or warnings, but such decoders will soon by abolished by popular approbation or lack thereof.
Originally posted by @jbowler in pnggroup/libpng#903 (comment)