我正在使用gm模块。这是我的代码:
gm(picture.path).thumb('250', '180', picture.thumb_path, 100, function (error) {
if(error) console.log(error);
});
但有时结果大小为249x180。我需要250x180。
我正在使用gm模块。这是我的代码:
gm(picture.path).thumb('250', '180', picture.thumb_path, 100, function (error) {
if(error) console.log(error);
});
但有时结果大小为249x180。我需要250x180。
imageMagick(picture.path)
.resize('250', '180', '^')
.gravity('center')
.extent(250, 180)
.write(picture.thumb_path, function (error) {
if(error) console.log(error);
});