- 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.
- 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.
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 intentionally excludes time of loading corresponding modules, and only measures actual processing.
While this is not perfect as it's not integrated in the UI (cc @jakearchibald), it gives at least some way to measure performance of different codecs and their integrations on particular files.
This delegates loading of Wasm modules to Webpack itself, making wrapper code simpler.
Emscripten-generated modules are still using custom loading glue as they're not compatible with Webpack.
* Scaling works on native
* It works in wasm
* Integrate with UI
* Remove benchmark
* Integrate Hqx into Resizer module
* Link against repo for hqx
* Remove unused defaultOpts
* Re-add test file
* Adding size dropdown
* Chrome: go and sit on the naughty step
* Better docs
* Review
* Add link to crbug
* Update src/codecs/processor-worker/index.ts
Co-Authored-By: Jake Archibald <jaffathecake@gmail.com>
* Terminate worker inbetween resize jobs
* Add sRGB -> RGB conversion before resize
* Add clamping for color space conversions
* Clip for demultiplication as well
* Fixing linear <-> srgb conversion
* Update benchmark
* Decouple srgb calculations
* Generate lookup tables
* Update src/codecs/resize/options.tsx
* Defaulting on, renaming, removing redundant state
* Implement alpha premultiplication
* Add benchmark to resize
* Only display "Premultiply alpha" if it's one of the rust resize types.
* Add comment about division by zero
* Update dependency typescript to v3.3.1
* Fix trailing commas for function calls
* Reverting trailing comma change
* Avoiding trailing comma rule for imports
* I never know what the right thing to do is
* lockfile
* Add a serviceworker
* rename + fix random extra character
* Fixing worker typings
* Fixing types properly this time.
* Once of those rare cases where this matters.
* Naming the things.
* Move registration to the app (so we can use snackbar later)
* Moving SW plugin later so it picks up things like HTML
* MVP service worker
* Two stage-service worker
* Fix prerendering by conditionally awaiting Custom Elements polyfill.
* Fix icon 404's
* add doc comment to autoswplugin
* Fix type
* Adding chroma subsampling for mozjpeg
* Adding separate chroma quality.
* Preact sometimes removes the inline styles, this fixes it.
* Simplifying chroma subsample
* Adding comments
* wip
* Commenting stuff to keep the build happy
* Revealing sections
* Custom select elements & more form work
* Range input styles
* Text fields with inputs do the right thing
* Safari & Firefox fixes
* Large compress select
* oops
* MozJPEG options updated
* OptPNG options
* These asserts weren't true
* Generic options
* WebP options
* Hiding "edit" when "original image"
* Download icon
* Copy setting button - still not happy with this
* Progress indicator
* Loading icon enter/exit anim
* Preventing controls going under options
* Ahh so that's what was causing scrolling
* Ahh so that's what was causing outlines
* Simplifying range styles and fixing cross-browser
* Processing custom element styles
* Get precision from step by default
* I don't know how or when this happened.
* Don't need that many steps
* Avoid having an element that covers the pinch zoom
* Preventing overlap with zoom controls
* Prevent ts warning
* Fixing spinner position
* Simplifying FileSize
* Splitting main part of app out of the main bundle.
Also improving the transition from intro to compressor.
* Showing error if app fails to load.
* lol these aren't async
* Please don't tell anyone I did this
* Spinner if user selects a file before the app has loaded. (#208)
* Allow loading SVG. Fixes#138.
I also made the resizer vector-aware, so you can resize the image larger & stay sharp.
* Handling SVG without width/height set.
* Simplifying maths
* Doh, case sensitive