Skip to content

Commit

Permalink
fix the homepage and re add toc
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaBrest committed Jul 16, 2023
1 parent 631dc01 commit 7c8a1a2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "icns-rs"
version = "0.1.1"
version = "0.1.2"
edition = "2021"
description = "A library for reading and writing Apple Icon Image (.icns) files."
license = "LGPL-3.0-or-later"
Expand Down
Binary file modified example.icns
Binary file not shown.
6 changes: 3 additions & 3 deletions src/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,17 +86,17 @@ impl IconFamily {
/// and compile all the data into a single file.
pub fn build(&self) -> Box<[u8]> {
// Calculate the total size of the file
// let contents_table = self.create_contents_table();
let contents_table = self.create_contents_table();

// Insert the TOC first
let mut data = Vec::with_capacity(self.data.len() + 1);
// data.push(contents_table);
data.push(contents_table);
for d in &self.data {
data.push(d.clone());
}

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

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

0 comments on commit 7c8a1a2

Please sign in to comment.