0
我需要調整圖像大小。因此,在下面的三個庫中,如何找到哪一個花費更少的時間調整圖像大小。在imagemacik,imagemacik-native和graphicsmagick中調整圖像大小所需的時間?
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...');
});
可能重複[如何測量回調JavaScript代碼的執行時間](http://stackoverflow.com/questions/10617070/how-to-measure-execution-time-of-javascript-code-with-callbacks ) 您是要求人們爲您編碼嗎,或者您有一些具體問題?請分享您面臨的特定問題。 – moka