Merge v2 codecs (#844)

* wip

* doh, whitespace

* Updating emscripten, restoring export name

* Updating oxipng

* Build wasm

* Fix oxipng; upgrade Rust

* More v2-codec integration

* AVIF now working

* Non-working JXL

* Build hqx with Rust 1.40; refactor build-rust*.sh

* Set web target

* wp2 wip

* wp2 decode options

* Better logo height when loading the logo into squoosh

* Build oxi

* JAKE IS AN IDIOT

* wip oxipng

* Fixing case sensitive imports

* adding log

* another log

* Abort tasks when compress component removed

* Adding progressive option to JXL

* Fix bug going to & from original image

* Exposing epf in jxl

* logs

* Bypass initial CSS plugin

* Revert "logs"

* Adding root

* Fix for finding TSC on Windows

* Use spawn again

* Converting to module paths

* Remove spawnP

* silly

* oops

* logs

* Fixing glob paths in CSS plugin

* Path normalising

* Normalise paths for CSS plugin

* Normalise again

* Use correct func

* Adding lossless mode and near lossless (but hidden in UI)

* Removing useless comments

* Some logging

* Update JXL to v0.1. (#846)

* Rebuild JXL

* Adding slight loss option

Co-authored-by: Ingvar Stepanyan <rreverser@google.com>
Co-authored-by: Luca Versari <veluca93@gmail.com>
This commit is contained in:
Jake Archibald
2020-11-19 10:55:43 +00:00
committed by GitHub
parent 39ca054112
commit 7346511fa1
98 changed files with 20085 additions and 1884 deletions

View File

@@ -27,7 +27,7 @@ import Options from './Options';
import ResultCache from './result-cache';
import { cleanMerge, cleanSet } from '../util/clean-modify';
import './custom-els/MultiPanel';
import Results from './results';
import Results from './Results';
import WorkerBridge from '../worker-bridge';
import { resize } from 'features/processors/resize/client';
import type SnackBarElement from 'shared/initial-app/custom-els/snack-bar';
@@ -101,6 +101,12 @@ async function decodeImage(
if (mimeType === 'image/webp') {
return await workerBridge.webpDecode(signal, blob);
}
if (mimeType === 'image/jpegxl') {
return await workerBridge.jxlDecode(signal, blob);
}
if (mimeType === 'image/webp2') {
return await workerBridge.wp2Decode(signal, blob);
}
// If it's not one of those types, fall through and try built-in decoding for a laugh.
}
return await abortable(signal, builtinDecode(blob));
@@ -360,6 +366,10 @@ export default class Compress extends Component<Props, State> {
componentWillUnmount(): void {
updateDocumentTitle();
this.mainAbortController.abort();
for (const controller of this.sideAbortControllers) {
controller.abort();
}
}
componentDidUpdate(prevProps: Props, prevState: State): void {
@@ -495,6 +505,8 @@ export default class Compress extends Component<Props, State> {
const needsProcessing =
needsPreprocessing ||
!latestSideJob.processorState ||
// If we're going to or from 'original image' we should reprocess
!!latestSideJob.encoderState !== !!sideJobStates[i].encoderState ||
!processorStateEquivalent(
latestSideJob.processorState,
sideJobStates[i].processorState,