http-image-size-promise
承诺通过 HTTP(S) 检测图像文件的尺寸,使用
var httpImageSizePromise = require ( 'http-image-size-promise' ) ;
httpImageSizePromise ( 'http://placehold.it/350x150' )
. then ( function ( dimensions ) {
dimensions ; //=> {width: 350, height: 150, type: 'gif'}
} )
. catch ( function ( reason ) {
console . warn ( reason ) ;
} ) ;
安装
npm install --save http-image-size-promise
支持的图像格式
检查
评论0
最新资源