【发布时间】:2019-01-25 01:19:39
【问题描述】:
我想调整通过输入文件获得的图像大小。我发现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.
【问题讨论】:
-
谢谢。当我在我的网站上显示图片时,我最终使用了图片 URL
-
那个答案根本没有提到吉普......? @ShaifulIslam
标签: javascript image image-resizing