Update packages

This commit is contained in:
Essem 2021-11-20 00:55:25 -06:00
parent 636857e20f
commit e179b923f0
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C
7 changed files with 521 additions and 564 deletions

View file

@ -15,7 +15,7 @@ function run(object) {
buffer: Buffer.alloc(0),
fileExtension: "nogif"
});
promise = fetch(object.path).then(res => res.buffer());
promise = fetch(object.path).then(res => res.arrayBuffer()).then(buf => { return Buffer.from(buf); });
}
// Convert from a MIME type (e.g. "image/png") to something ImageMagick understands (e.g. "png").
// Don't set `type` directly on the object we are passed as it will be read afterwards.

View file

@ -35,7 +35,7 @@ export async function getType(image, extraReturnTypes) {
type = "large";
return type;
}
const imageBuffer = await imageRequest.buffer();
const imageBuffer = await imageRequest.arrayBuffer();
const imageType = await fileType.fromBuffer(imageBuffer);
if (imageType && formats.includes(imageType.mime)) {
type = imageType.mime;

View file

@ -177,7 +177,7 @@ class ImageWorker extends BaseServiceWorker {
"Authentication": auth && auth !== "" ? auth : undefined
}
});
const image = await imageReq.buffer();
const image = Buffer.from(await imageReq.arrayBuffer());
// The response data is given as the file extension/ImageMagick type of the image (e.g. "png"), followed
// by a newline, followed by the image data.