【问题标题】:Resizing image from input file with Jimp使用 Jimp 从输入文件调整图像大小
【发布时间】: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.

【问题讨论】:

标签: javascript image image-resizing


【解决方案1】:

可能不支持您的文件类型,我认为 jimp 仅支持 png、jpg、bmp。祝你有美好的一天!

【讨论】:

    猜你喜欢
    • 2016-12-09
    • 1970-01-01
    • 1970-01-01
    • 2018-05-03
    • 1970-01-01
    • 2011-08-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多