From 4b21730bb3edd2602991c99cefe835578d83a57d Mon Sep 17 00:00:00 2001 From: Andrew Date: Thu, 11 May 2023 14:59:55 +1200 Subject: [PATCH] Rename header to chunk --- src/lib.rs | 6 +++--- tests/raw.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 45cfe430..ee6b8c7c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -368,8 +368,8 @@ impl RawImage { }) } - /// Add a png header chunk, such as "iTXt", to be included in the output - pub fn add_png_header(&mut self, chunk_type: [u8; 4], data: Vec) { + /// Add a png chunk, such as "iTXt", to be included in the output + pub fn add_png_chunk(&mut self, chunk_type: [u8; 4], data: Vec) { // We can guarantee this will succeed - failure indicates a bug let png = Arc::get_mut(&mut self.png).unwrap(); png.aux_headers.insert(chunk_type, data); @@ -383,7 +383,7 @@ impl RawImage { iccp.extend(b"icc"); // Profile name - generally unused, can be anything iccp.extend([0, 0]); // Null separator, zlib compression method iccp.append(&mut compressed); - self.add_png_header(*b"iCCP", iccp); + self.add_png_chunk(*b"iCCP", iccp); } } diff --git a/tests/raw.rs b/tests/raw.rs index 997837a4..03802444 100644 --- a/tests/raw.rs +++ b/tests/raw.rs @@ -32,7 +32,7 @@ fn test_it_converts(input: &str) { .unwrap(); for (chunk_type, data) in png.aux_headers { - raw.add_png_header(chunk_type, data); + raw.add_png_chunk(chunk_type, data); } let output = raw.create_optimized_png(&opts).unwrap();