How can I get the size, height and width of an image in when upload it with jQuery?
Asked
Active
Viewed 187 times
0
-
3This question is not very clear. Include a small code example and/or clarify the question. – jfriend00 Jul 23 '11 at 16:13
-
I'm not sure what you are implying by "..uploade it with jQuery", but my guess is that you will find your answer here http://goo.gl/m1J8V – Jed Jul 23 '11 at 16:15
-
possible duplicate of [Determine original size of image cross browser?](http://stackoverflow.com/questions/1944280/determine-original-size-of-image-cross-browser) – Brock Adams Jul 23 '11 at 16:24
2 Answers
2
if you use jquery uploadify plugin then you can find the file size by any one of these following method
'onSelect': function(event, ID, fileObj) {
console.log(fileObj.size);
}
OR,
'onComplete': function(event, ID, fileObj, response, data) {
console.log(fileObj.size);
}
and use
$('img').css('width');
$('img').css('height');

thecodeparadox
- 86,271
- 21
- 138
- 164