Skip to content

Commit 7c8a1a2

Browse files
committed
fix the homepage and re add toc
1 parent 631dc01 commit 7c8a1a2

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "icns-rs"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
edition = "2021"
55
description = "A library for reading and writing Apple Icon Image (.icns) files."
66
license = "LGPL-3.0-or-later"

example.icns

152 Bytes
Binary file not shown.

src/encode.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,17 @@ impl IconFamily {
8686
/// and compile all the data into a single file.
8787
pub fn build(&self) -> Box<[u8]> {
8888
// Calculate the total size of the file
89-
// let contents_table = self.create_contents_table();
89+
let contents_table = self.create_contents_table();
9090

9191
// Insert the TOC first
9292
let mut data = Vec::with_capacity(self.data.len() + 1);
93-
// data.push(contents_table);
93+
data.push(contents_table);
9494
for d in &self.data {
9595
data.push(d.clone());
9696
}
9797

9898
let total_size = data.iter().map(|data| data.len()).sum::<u32>();
99-
let mut buffer = Vec::with_capacity(total_size as usize);
99+
let mut buffer = Vec::with_capacity(8 + total_size as usize);
100100

101101
// Add the magic bytes, the total size and the data
102102
buffer.extend_from_slice(&MAGIC);

0 commit comments

Comments
 (0)