Given a list of image paths how can I iterate through them and find the actual image dimensions? I assume I have to insert them into the DOM without width or height propert
var paths = ['/path/image.png', 'somewhere/page.jpg']; $.each(paths, function(i, path) { var img = new Image(); $(img).load(function() { var width = img.width, height = img.height; alert(width + ' × ' + height); }); img.src = path; });
See it on jsFiddle.