是的,这是可能的,但是您需要安装GraphicsMagick或ImageMagick。
我都用过,我可以推荐GraphicsMagick,它要快得多。
一旦安装了程序及其模块,就可以执行以下操作来获取宽度和高度。
gm = require('gm');// obtain the size of an imagegm('test.jpg').size(function (err, size) { if (!err) { console.log('width = ' + size.width); console.log('height = ' + size.height); }});


