Closed wvanbergen closed 8 years ago
Makes sense to me
On Sun, Jun 19, 2016, 4:40 AM Willem van Bergen notifications@github.com wrote:
Stop reading from a stream after the IEND chunk has been seen, instead of until the EOF of the stream. This prevents a stream with trailing data to raise an exception failed error.
According to the PNG spec: "The IEND chunk marks the end of the PNG datastream.". So i think it is fair to stop reading once we have seen it.
Fixes #96 https://github.com/wvanbergen/chunky_png/issues/96. FYI @whoisjake https://github.com/whoisjake @ebds https://github.com/ebds
@rrjamie https://github.com/rrjamie @lencioni
https://github.com/lencioni Does this make sense?
You can view, comment on, or merge this pull request online at:
https://github.com/wvanbergen/chunky_png/pull/111 Commit Summary
- Stop reading from a stream after the IEND chunk has been seen, instead of until EOF. This prevents a stream with trailing data to raise an exception failed error.
File Changes
- M lib/chunky_png/datastream.rb https://github.com/wvanbergen/chunky_png/pull/111/files#diff-0 (2)
- M spec/chunky_png/datastream_spec.rb https://github.com/wvanbergen/chunky_png/pull/111/files#diff-1 (6)
- A spec/resources/trailing_bytes_after_iend_chunk.png https://github.com/wvanbergen/chunky_png/pull/111/files#diff-2 (0)
Patch Links:
- https://github.com/wvanbergen/chunky_png/pull/111.patch
- https://github.com/wvanbergen/chunky_png/pull/111.diff
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/wvanbergen/chunky_png/pull/111, or mute the thread https://github.com/notifications/unsubscribe/AAL7zvEGFrOdHGTe76fijFfl0c4pJDV_ks5qNSqwgaJpZM4I5JZL .
Stop reading from a stream after the IEND chunk has been seen, instead of until the EOF of the stream. This prevents a stream with trailing data to raise an exception failed error.
According to the PNG spec: "The IEND chunk marks the end of the PNG datastream.". So i think it is fair to stop reading once we have seen it.
Fixes #96. FYI @whoisjake @ebds
@rrjamie @lencioni Does this make sense?