diff options
author | pommicket <pommicket@gmail.com> | 2023-09-05 22:37:10 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-09-05 22:37:10 -0400 |
commit | 6fdb5619052ff68face6ad06b4423776ce8bd4f2 (patch) | |
tree | 68d65c8354cfcb71276b6cc36a7f26449efcf75f /examples/wasm-tiny-png | |
parent | d990a922652d5adaab61ea8b8c461f624b53dc84 (diff) |
rename to minipng0.1.0
Diffstat (limited to 'examples/wasm-tiny-png')
-rw-r--r-- | examples/wasm-tiny-png/.cargo/config.toml | 2 | ||||
-rw-r--r-- | examples/wasm-tiny-png/Cargo.toml | 14 | ||||
-rw-r--r-- | examples/wasm-tiny-png/src/lib.rs | 15 |
3 files changed, 0 insertions, 31 deletions
diff --git a/examples/wasm-tiny-png/.cargo/config.toml b/examples/wasm-tiny-png/.cargo/config.toml deleted file mode 100644 index f4e8c00..0000000 --- a/examples/wasm-tiny-png/.cargo/config.toml +++ /dev/null @@ -1,2 +0,0 @@ -[build] -target = "wasm32-unknown-unknown" diff --git a/examples/wasm-tiny-png/Cargo.toml b/examples/wasm-tiny-png/Cargo.toml deleted file mode 100644 index 5c8dae5..0000000 --- a/examples/wasm-tiny-png/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "wasm-tiny-png" -version = "0.1.0" -edition = "2021" - -[lib] -crate-type = ["cdylib"] - -[dependencies] -tiny-png = { path = "../.." } - -[profile.release] -opt-level = "z" -lto = true diff --git a/examples/wasm-tiny-png/src/lib.rs b/examples/wasm-tiny-png/src/lib.rs deleted file mode 100644 index 449b67d..0000000 --- a/examples/wasm-tiny-png/src/lib.rs +++ /dev/null @@ -1,15 +0,0 @@ -#[no_mangle] -pub unsafe fn decode_png(input: *const u8, input_len: usize, output: *mut u8, output_len: usize) -> usize { - let input = core::slice::from_raw_parts(input, input_len); - let output = core::slice::from_raw_parts_mut(output, output_len); - let Ok(header) = tiny_png::decode_png_header(input) else { - return 0; - }; - let required_bytes = header.required_bytes(); - if output_len >= required_bytes { - if tiny_png::decode_png(input, output).is_err() { - return 0; - } - } - required_bytes -} |