forked from external-repos/squoosh
Swap OptiPNG with OxiPNG
This makes building simpler and allows us to potentially use multithreading version in the future. For now points to a custom fork of OxiPNG that enables WebAssembly support, as PR is still pending review.
This commit is contained in:
committed by
Ingvar Stepanyan
parent
4621cbcae9
commit
629d64326d
7
codecs/oxipng/src/lib.rs
Normal file
7
codecs/oxipng/src/lib.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
#[wasm_bindgen(catch)]
|
||||
pub fn optimise(data: &[u8], level: u8) -> Vec<u8> {
|
||||
let options = oxipng::Options::from_preset(level);
|
||||
oxipng::optimize_from_memory(data, &options).unwrap_throw()
|
||||
}
|
||||
Reference in New Issue
Block a user