diff --git a/src/encoder.rs b/src/encoder.rs index ac23a68e..208ef641 100644 --- a/src/encoder.rs +++ b/src/encoder.rs @@ -662,8 +662,10 @@ impl Writer { /// Write a raw chunk of PNG data. /// - /// The chunk will have its CRC calculated and correctly. The data is not filtered in any way, - /// but the chunk needs to be short enough to have its length encoded correctly. + /// This function calculates the required CRC sum so this should not be included in the input + /// `data`, otherwise the data is not filtered in any way. This function returns an error if + /// the length of `data` can't be parsed as a `u32` though the length of the chunk data should + /// not exceed `i32::MAX` or 2,147,483,647. pub fn write_chunk(&mut self, name: ChunkType, data: &[u8]) -> Result<()> { use std::convert::TryFrom;