我需要调整图像大小。所以在下面的三个库中,如何找到哪个库需要更少的时间来调整图像大小。
https://github.com/rsms/node-imagemagick
https://github.com/mash/node-imagemagick-native
https://github.com/aheckmann/gm
示例代码
var im = require('imagemagick');
var sourcePath='/tmp/Images/1.jpeg';
var destinationPath='/tmp/ResizedImages/resized.png';
im.resize({
srcPath: sourcePath,
dstPath: destinationPath,
width: 90,
height:100,
},function(err,res){
if(err){
console.log('Error while resizing image '+err);
return;
}
console.log('Image resized successfully...');
});