我想调整我通过输入文件得到的图像的大小。我发现jimp似乎是个不错的选择。我的问题是我不知道如何在文件上使用它。我尝试使用这种方法:
Jimp.read(lenna.buffer)
.then(image => {
// do stuff with the image
})
.catch(err => {
// handle an exception
});其中lenna是我的文件,但我得到一个错误:
No matching constructor overloading was found.
Please see the docs for how to call the Jimp constructor.发布于 2020-06-20 19:20:40
可能你的文件类型不被支持,我认为jimp只支持png,jpg,bmp。祝您今天愉快!
https://stackoverflow.com/questions/51904857
复制相似问题