Merge branch 'SwanX1-master'

This commit is contained in:
Essem 2022-01-16 16:11:44 -06:00
commit 24b828ccf6
No known key found for this signature in database
GPG key ID: 7D497397CC3A2A8C

View file

@ -9,13 +9,13 @@ const magick = nodeRequire(`../build/${process.env.DEBUG && process.env.DEBUG ==
function run(object) {
return new Promise((resolve, reject) => {
// If the image has a path, it must also have a type
let promise = new Promise((resolveTest) => { resolveTest(); }); // no-op
let promise = Promise.resolve();
if (object.path) {
if (object.params.type !== "image/gif" && object.onlyGIF) resolve({
buffer: Buffer.alloc(0),
fileExtension: "nogif"
});
promise = fetch(object.path).then(res => res.arrayBuffer()).then(buf => { return Buffer.from(buf); });
promise = fetch(object.path).then(res => res.arrayBuffer()).then(buf => 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.