Fix bug where GIF input would error on output.
Also minor corrections to jsdocs in ImageManipulation
This commit is contained in:
1 parent
b312e17904
commit
6a01e40394
17 files changed
+118
-26
No files matched your search
@@ -116,7 +116,12 @@ class CropImage extends Operation {
|
||||
image.crop(xPos, yPos, width, height);
|
||||
}
|
||||
|
||||
const imageBuffer = await image.getBufferAsync(jimp.AUTO);
|
||||
let imageBuffer;
|
||||
if (image.getMIME() === "image/gif") {
|
||||
imageBuffer = await image.getBufferAsync(jimp.MIME_PNG);
|
||||
} else {
|
||||
imageBuffer = await image.getBufferAsync(jimp.AUTO);
|
||||
}
|
||||
return [...imageBuffer];
|
||||
} catch (err) {
|
||||
throw new OperationError(`Error cropping image. (${err})`);
|
||||
|
||||
Reference in new issue
Block a user