fex-team / webuploader

It's a new file uploader solution!
http://fex.baidu.com/webuploader/
BSD 3-Clause "New" or "Revised" License
7.71k stars 2.33k forks source link

上传之前需要校验,如何获取图片的真实宽高? #1224

Open gongff opened 9 years ago

gongff commented 9 years ago

插件已经设置了图片预览的大小,创建一个image对象后获取的宽高永远是thumb预览的宽高,用naturalWidth也不行,怎么解决呢

cjg125 commented 9 years ago
uploader.makeThumb(file, function (error, src) {
    console.log(file._info.width + '*' + file._info.height)
}, 100, 100);
gongff commented 9 years ago

之前也是这么取的是undefined不知咋回事,现在解决了,谢谢你

zi-hong commented 8 years ago

碰到相同的问题 楼上怎么解决的?

gongff commented 8 years ago

就是 huhu11lala 写的那样

chengwb53 commented 7 years ago

undefined怎么解决的?

chengwb53 commented 7 years ago

https://github.com/fex-team/webuploader/issues/1040

big-tutu commented 6 years ago

uploader.on('fileQueued', file => { uploader.makeThumb(file, function (error, src) { console.log(file._info.width + '*' + file._info.height) }, 100, 100); })