FEATURE: Optimize images before upload (#13432)

Integrates [mozJPEG](https://github.com/mozilla/mozjpeg) and [Resize](https://github.com/PistonDevelopers/resize) using WebAssembly to optimize user uploads in the composer on the client-side.

NPM libraries are sourced from our [Squoosh fork](https://github.com/discourse/squoosh/tree/discourse), which was needed because we have an older asset pipeline.
This commit is contained in:
Rafael dos Santos Silva
2021-06-23 12:31:12 -03:00
committed by GitHub
parent 18de11f3a6
commit fa4a462517
20 changed files with 784 additions and 5 deletions

View File

@ -112,6 +112,8 @@ def dependencies
source: 'blueimp-file-upload/js/jquery.fileupload.js',
}, {
source: 'blueimp-file-upload/js/jquery.iframe-transport.js',
}, {
source: 'blueimp-file-upload/js/jquery.fileupload-process.js',
}, {
source: 'blueimp-file-upload/js/vendor/jquery.ui.widget.js',
}, {
@ -191,6 +193,30 @@ def dependencies
{
source: 'sinon/pkg/sinon.js'
},
{
source: 'squoosh/codecs/mozjpeg/enc/mozjpeg_enc.js',
destination: 'squoosh',
public: true,
skip_versioning: true
},
{
source: 'squoosh/codecs/mozjpeg/enc/mozjpeg_enc.wasm',
destination: 'squoosh',
public: true,
skip_versioning: true
},
{
source: 'squoosh/codecs/resize/pkg/squoosh_resize.js',
destination: 'squoosh',
public: true,
skip_versioning: true
},
{
source: 'squoosh/codecs/resize/pkg/squoosh_resize_bg.wasm',
destination: 'squoosh',
public: true,
skip_versioning: true
},
]
end