Change 'encodedAs' to 'encodedWith'

This commit is contained in:
atjn
2021-05-13 19:34:50 +02:00
parent 875c24525b
commit 25754b91b7
3 changed files with 12 additions and 10 deletions

View File

@@ -91,6 +91,7 @@ async function encodeImage({
return {
optionsUsed,
binary,
extension: encoders[encName].extension,
size: binary.length,
};
}
@@ -117,7 +118,7 @@ class Image {
constructor (workerPool, file) {
this.workerPool = workerPool;
this.decoded = workerPool.dispatchJob({operation: 'decode', file});
this.encodedAs = {};
this.encodedWith = {};
}
/**
@@ -165,7 +166,7 @@ class Image {
encRef.defaultEncoderOptions,
options,
);
this.encodedAs[encRef.extension] = this.workerPool.dispatchJob({
this.encodedWith[encName] = this.workerPool.dispatchJob({
operation: 'encode',
bitmap,
encName,
@@ -178,7 +179,7 @@ class Image {
),
});
}
await Promise.all(Object.values(this.encodedAs));
await Promise.all(Object.values(this.encodedWith));
}
}