Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reworded docs for encoder::Writer::write_chunk() #565

Merged
merged 2 commits into from
Jan 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -662,8 +662,10 @@ impl<W: Write> Writer<W> {

/// 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;

Expand Down
Loading