Commit Graph

341 Commits

Author SHA1 Message Date
Ingvar Stepanyan
8036579a3c RawImage -> ImageData; report errors with null 2020-08-05 15:10:33 +01:00
Ingvar Stepanyan
0807fa4b9a Remove obsolete free_result refs 2020-08-05 14:40:15 +01:00
Surma
0218d0aac5 Avoid leaks during encoding 2020-08-05 14:40:04 +01:00
Surma
cfba6e7bd5 Disable examples 2020-08-05 14:39:58 +01:00
Surma
c6015e2e8d Don't copy dem pixels 2020-08-05 14:39:54 +01:00
Surma
94a2a7b32f Free pixels 2020-08-05 14:39:50 +01:00
Surma
03f33847a3 Code review 2020-08-05 14:39:46 +01:00
Surma
563b558204 Remove free() method 2020-08-05 14:39:41 +01:00
Surma
3c92f2d531 Download sources as tar.gz 2020-08-05 14:39:35 +01:00
Surma
f5ab9a9a59 Remove CFLAGS and improve git folder targets 2020-08-05 14:39:30 +01:00
Surma
7893660679 Fix alpha channel in encoder 2020-08-05 14:39:26 +01:00
Surma
15dac42a7f Remove stray files 2020-08-05 14:39:21 +01:00
Surma
53298a23ad Remove package.json and move git to Makefile 2020-08-05 14:39:14 +01:00
Surma
7ffa45ba86 Update libavif and libaom 2020-08-05 14:39:07 +01:00
Surma
ee99cf6e0b Move to makefile for AVIF 2020-08-05 14:39:01 +01:00
Ingvar Stepanyan
2edb8cbd7e Upgrade AVIF decoding code
- Update to newer APIs.
 - Avoid manual pixel-by-pixel copy in favour of decoding directly to desired format & bit depth.
 - Avoid use-after-free by cloning the Uint8Array Wasm memory view into a JS-owned Uint8Array right away.
2020-08-05 14:38:56 +01:00
Ingvar Stepanyan
0ac3d17969 Move AOM cloning to napa 2020-08-05 14:38:51 +01:00
Ingvar Stepanyan
1baa823d77 Upgrade libavif 2020-08-05 14:38:48 +01:00
Ingvar Stepanyan
368ad9505e Use make -j in AVIF 2020-08-05 14:38:42 +01:00
Ingvar Stepanyan
08c267a98b Add LTO to AVIF 2020-08-05 14:38:37 +01:00
Ingvar Stepanyan
0c3ef3fdf5 Migrate AVIF to Emscripten upstream 2020-08-05 14:38:33 +01:00
Surma
17dcc9c7d4 Update AVIF encoder README 2020-08-05 14:38:31 +01:00
Surma
ac9a7767d2 Expose some options for AVIF 2020-08-05 14:38:29 +01:00
Surma
c29006d593 Add AVIF encoder without options 2020-08-05 14:38:26 +01:00
Surma
e1ab43b76f Add AVIF encoder 2020-08-05 14:38:23 +01:00
Surma
409df481db Fix HDR image support in AVIF decoder 2020-08-05 14:38:19 +01:00
Surma
34cb55978f Add avif decoder binaries 2020-08-05 14:36:21 +01:00
Surma
d0f5d5a644 Make build-cpp.sh executable 2020-08-04 13:35:58 +01:00
Ingvar Stepanyan
1a26057452 Switch from napa to curl
Instead of using 127 deps brought by napa just to download the one dependency we actually care about, just use curl & tar directly from Makefile.
2020-07-30 13:28:41 +01:00
Ingvar Stepanyan
9c0a375f01 Fixup HQX build
Porting over few more improvements from #777 that can be applied to HQX despite the older Rust version:

 - Removed Cargo.lock from .gitignore (the file itself was added in the original PR, but is still ignored and wouldn't get committed on changes).
 - Removed couple of stray .DS_Store accidentally added in that PR.
 - Added a `--locked` to `wasm-pack` build to make sure we rebuild HQX with the same versions from Cargo.lock.
 - Removed separate `wasm-strip` and `wasm-opt -Os` steps from build.sh in HQX because they're already included in wasm-pack, and running twice only makes build slower.
2020-07-28 18:37:17 +01:00
Ingvar Stepanyan
d1cff7d84e Consolidate C++ builds
Use a shared base image with fixed Emscripten version, autotools and optimisation flags for all C++ codecs.

Additionally, move build commands for codecs themselves to Makefile - they're already platform-specific, and Make allows for better caching and parallelisation that custom ad-hoc scripts.

This is essentially same as #777 but for C++.
2020-07-28 18:05:09 +01:00
Ingvar Stepanyan
e342766cbf Switch vals to thread_locals
It's not possible to share them across threads, so in case we decide to use multithreading in the future, it's best to mark them as thread_local right away, even if it's a no-op right now.
2020-07-28 16:35:00 +01:00
Ingvar Stepanyan
f1cd6a87da Update JS/Wasm 2020-07-28 16:35:00 +01:00
Ingvar Stepanyan
39e5741cb2 Fix few more issues detected in MozJPEG wrapper 2020-07-28 16:35:00 +01:00
Ingvar Stepanyan
93cbe557cd Simplify memory management for other C++ codecs 2020-07-28 16:35:00 +01:00
Ingvar Stepanyan
97931bad22 C++ify imagequant memory management 2020-07-28 16:35:00 +01:00
Ingvar Stepanyan
1f35c40d3f Create Uint8ClampedArray from C++ 2020-07-28 16:35:00 +01:00
Ingvar Stepanyan
c39383333f Localize variables in imagequant 2020-07-28 16:35:00 +01:00
Jake Archibald
b7f7a5ac0a Rebuild resize wasm 2020-07-24 14:52:24 +01:00
Surma
dd895f026b Remove old wasm files 2020-07-24 14:25:55 +01:00
Surma
ca00a22303 Reset HQX to old build system 2020-07-24 13:29:40 +01:00
Jake Archibald
1ce6dd73d8 Fix clamping. Fixes #782. Fixes #711. 2020-07-24 12:52:21 +01:00
Ingvar Stepanyan
718427badb Use lockfiles & update Rust deps 2020-07-14 17:23:31 +01:00
Ingvar Stepanyan
c5c520a71d Consolidate Rust builds
This consolidates Rust build process for various codecs into a single top-level image that is built once and reused.

This ensures that we use same version of tools across codecs (now controlled from a single place), simplifies build configs and commands, speeds up common builds and reduces disk space taken by Docker images by reusing same one.

Additionally, this PR renames all codecs to squoosh-* to work around the https://github.com/rustwasm/wasm-pack/issues/829 (which has been already fixed on master of wasm-pack but not released in a while), as well as adds `publish = false` to Cargo.toml to avoid accidental publishing for now.

I'm planning to do similar for Emscripten in a separate PR, although abilities to share configs there are much more limited due to lack of package manager in C++.
2020-07-14 17:20:40 +01:00
Jake Archibald
17ffa57a8b Updating oxi build & enabling alpha optimisations (#776)
* Updating oxi build & enabling alpha optimisations

* Renaming package
2020-07-14 16:19:35 +01:00
Ingvar Stepanyan
1ae93b527c Revert docker run --rm change 2020-05-13 19:39:27 +01:00
Ingvar Stepanyan
a95cb740bf Format C / C++ with Chromium style 2020-05-13 19:39:27 +01:00
Ingvar Stepanyan
de543b3206 Further speed improvements
- Store Emscripten cache inside node_modules/.em_cache. Docker image ships without LTO libs, so Emscripten has to rebuild stdlibs on every build otherwise.
 - Merge webp_enc + webp_dec build scripts. Core libwebp library is same in both cases, so there's no point in storing and building two copies of it.
2020-05-13 19:39:27 +01:00
Ingvar Stepanyan
1542bfb7fd Tweak up compile flags
- Remove unnecessary `-x c++`.
 - Improve rebuild speed by caching:
   - Remove `-f` from `autoreconf` to reuse generated configure scripts.
   - Remove `--rm` from `docker run` to avoid rebuilding Emscripten stdlib.
   - Add `-C` to `./configure` to reuse stored information about `emcc`.
   - Remove `rm -rf build` from WebP encoder/decoder.
2020-05-13 19:39:27 +01:00
Ingvar Stepanyan
bc8d75128f Remove libpng-dev dependency from WebP (#752)
It's unnecessary as we disable PNG support via ./configure anyway.

Co-authored-by: Surma <surma@surma.dev>
2020-05-05 13:23:12 +01:00