FIX: Pass fileName to error handler for media optimization (#14058)

The file name is used to look up the promise to resolve; it
was being passed for the successful path but not for the
error path.
This commit is contained in:
Martin Brennan
2021-08-17 09:33:16 +10:00
committed by GitHub
parent 9b7c17b925
commit 90ab520d06

View File

@@ -139,7 +139,8 @@ onmessage = async function (e) {
console.error(error);
postMessage({
type: "error",
file: e.data.file
file: e.data.file,
fileName: e.data.fileName
});
}
break;
@@ -172,4 +173,4 @@ async function loadLibs(settings){
await wasm_bindgen(settings.resize_wasm);
self.codecs = {mozjpeg_enc: mozjpeg_enc_module, resize: resize};
}
}