mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-12 00:37:19 +00:00
Point oxipng to patched version
Some upstream changes required for parallel build to work.
This commit is contained in:
4
codecs/oxipng/Cargo.lock
generated
4
codecs/oxipng/Cargo.lock
generated
@@ -347,13 +347,13 @@ checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "oxipng"
|
name = "oxipng"
|
||||||
version = "3.0.1"
|
version = "3.0.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "git+https://github.com/RReverser/oxipng?branch=crossbeam#d0f86d2e84eb55b423b8ad194a176e71ba3aa2c3"
|
||||||
checksum = "5687a277f33b5fe5ee2ff5ceab4417885a428a1a938e944aa7df9d7e58c35762"
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bit-vec",
|
"bit-vec",
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"cloudflare-zlib",
|
"cloudflare-zlib",
|
||||||
"crc",
|
"crc",
|
||||||
|
"crossbeam-channel",
|
||||||
"image",
|
"image",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"itertools",
|
"itertools",
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ rayon = { version = "1.3.0", optional = true }
|
|||||||
once_cell = { version = "1.3.1", optional = true }
|
once_cell = { version = "1.3.1", optional = true }
|
||||||
crossbeam-channel = { version = "0.4.2", optional = true }
|
crossbeam-channel = { version = "0.4.2", optional = true }
|
||||||
|
|
||||||
|
[patch.crates-io]
|
||||||
|
oxipng = { git = "https://github.com/RReverser/oxipng", branch = "crossbeam" }
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
lto = true
|
lto = true
|
||||||
opt-level = "s"
|
opt-level = "s"
|
||||||
@@ -24,4 +27,4 @@ opt-level = "s"
|
|||||||
parallel = ["oxipng/parallel", "rayon", "crossbeam-channel", "once_cell"]
|
parallel = ["oxipng/parallel", "rayon", "crossbeam-channel", "once_cell"]
|
||||||
|
|
||||||
[package.metadata.wasm-pack.profile.release]
|
[package.metadata.wasm-pack.profile.release]
|
||||||
wasm-opt = false
|
wasm-opt = ["-O", "--no-validation"]
|
||||||
|
|||||||
14
codecs/oxipng/pkg-parallel/squoosh_oxipng.d.ts
vendored
14
codecs/oxipng/pkg-parallel/squoosh_oxipng.d.ts
vendored
@@ -1,12 +1,6 @@
|
|||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
/**
|
/**
|
||||||
* @param {Uint8Array} data
|
|
||||||
* @param {number} level
|
|
||||||
* @returns {Uint8Array}
|
|
||||||
*/
|
|
||||||
export function optimise(data: Uint8Array, level: number): Uint8Array;
|
|
||||||
/**
|
|
||||||
* @param {number} num
|
* @param {number} num
|
||||||
* @returns {any}
|
* @returns {any}
|
||||||
*/
|
*/
|
||||||
@@ -17,16 +11,22 @@ export function start_main_thread(): void;
|
|||||||
/**
|
/**
|
||||||
*/
|
*/
|
||||||
export function start_worker_thread(): void;
|
export function start_worker_thread(): void;
|
||||||
|
/**
|
||||||
|
* @param {Uint8Array} data
|
||||||
|
* @param {number} level
|
||||||
|
* @returns {Uint8Array}
|
||||||
|
*/
|
||||||
|
export function optimise(data: Uint8Array, level: number): Uint8Array;
|
||||||
|
|
||||||
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
||||||
|
|
||||||
export interface InitOutput {
|
export interface InitOutput {
|
||||||
readonly optimise: (a: number, b: number, c: number, d: number) => void;
|
|
||||||
readonly malloc: (a: number) => number;
|
readonly malloc: (a: number) => number;
|
||||||
readonly free: (a: number) => void;
|
readonly free: (a: number) => void;
|
||||||
readonly worker_initializer: (a: number) => number;
|
readonly worker_initializer: (a: number) => number;
|
||||||
readonly start_main_thread: () => void;
|
readonly start_main_thread: () => void;
|
||||||
readonly start_worker_thread: () => void;
|
readonly start_worker_thread: () => void;
|
||||||
|
readonly optimise: (a: number, b: number, c: number, d: number) => void;
|
||||||
readonly __wbindgen_export_0: WebAssembly.Memory;
|
readonly __wbindgen_export_0: WebAssembly.Memory;
|
||||||
readonly __wbindgen_malloc: (a: number) => number;
|
readonly __wbindgen_malloc: (a: number) => number;
|
||||||
readonly __wbindgen_free: (a: number, b: number) => void;
|
readonly __wbindgen_free: (a: number, b: number) => void;
|
||||||
|
|||||||
@@ -33,6 +33,40 @@ function getStringFromWasm0(ptr, len) {
|
|||||||
return cachedTextDecoder.decode(getUint8Memory0().slice(ptr, ptr + len));
|
return cachedTextDecoder.decode(getUint8Memory0().slice(ptr, ptr + len));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getObject(idx) { return heap[idx]; }
|
||||||
|
|
||||||
|
function dropObject(idx) {
|
||||||
|
if (idx < 36) return;
|
||||||
|
heap[idx] = heap_next;
|
||||||
|
heap_next = idx;
|
||||||
|
}
|
||||||
|
|
||||||
|
function takeObject(idx) {
|
||||||
|
const ret = getObject(idx);
|
||||||
|
dropObject(idx);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* @param {number} num
|
||||||
|
* @returns {any}
|
||||||
|
*/
|
||||||
|
export function worker_initializer(num) {
|
||||||
|
var ret = wasm.worker_initializer(num);
|
||||||
|
return takeObject(ret);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
export function start_main_thread() {
|
||||||
|
wasm.start_main_thread();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*/
|
||||||
|
export function start_worker_thread() {
|
||||||
|
wasm.start_worker_thread();
|
||||||
|
}
|
||||||
|
|
||||||
let WASM_VECTOR_LEN = 0;
|
let WASM_VECTOR_LEN = 0;
|
||||||
|
|
||||||
function passArray8ToWasm0(arg, malloc) {
|
function passArray8ToWasm0(arg, malloc) {
|
||||||
@@ -75,40 +109,6 @@ export function optimise(data, level) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getObject(idx) { return heap[idx]; }
|
|
||||||
|
|
||||||
function dropObject(idx) {
|
|
||||||
if (idx < 36) return;
|
|
||||||
heap[idx] = heap_next;
|
|
||||||
heap_next = idx;
|
|
||||||
}
|
|
||||||
|
|
||||||
function takeObject(idx) {
|
|
||||||
const ret = getObject(idx);
|
|
||||||
dropObject(idx);
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* @param {number} num
|
|
||||||
* @returns {any}
|
|
||||||
*/
|
|
||||||
export function worker_initializer(num) {
|
|
||||||
var ret = wasm.worker_initializer(num);
|
|
||||||
return takeObject(ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export function start_main_thread() {
|
|
||||||
wasm.start_main_thread();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
export function start_worker_thread() {
|
|
||||||
wasm.start_worker_thread();
|
|
||||||
}
|
|
||||||
|
|
||||||
async function load(module, imports, maybe_memory) {
|
async function load(module, imports, maybe_memory) {
|
||||||
if (typeof Response === 'function' && module instanceof Response) {
|
if (typeof Response === 'function' && module instanceof Response) {
|
||||||
memory = imports.wbg.memory = new WebAssembly.Memory({initial:17,maximum:16384,shared:true});
|
memory = imports.wbg.memory = new WebAssembly.Memory({initial:17,maximum:16384,shared:true});
|
||||||
|
|||||||
Binary file not shown.
@@ -1,11 +1,11 @@
|
|||||||
/* tslint:disable */
|
/* tslint:disable */
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
export function optimise(a: number, b: number, c: number, d: number): void;
|
|
||||||
export function malloc(a: number): number;
|
export function malloc(a: number): number;
|
||||||
export function free(a: number): void;
|
export function free(a: number): void;
|
||||||
export function worker_initializer(a: number): number;
|
export function worker_initializer(a: number): number;
|
||||||
export function start_main_thread(): void;
|
export function start_main_thread(): void;
|
||||||
export function start_worker_thread(): void;
|
export function start_worker_thread(): void;
|
||||||
|
export function optimise(a: number, b: number, c: number, d: number): void;
|
||||||
export const __wbindgen_export_0: WebAssembly.Memory;
|
export const __wbindgen_export_0: WebAssembly.Memory;
|
||||||
export function __wbindgen_malloc(a: number): number;
|
export function __wbindgen_malloc(a: number): number;
|
||||||
export function __wbindgen_free(a: number, b: number): void;
|
export function __wbindgen_free(a: number, b: number): void;
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user