Answers for "how to get image size from url in javascript"

2

how to get img dimensions from remote url js

function getMeta(url, callback) {
    var img = new Image();
    img.src = url;
    img.onload = function() { callback(this.width, this.height); }
}
getMeta(
  "http://snook.ca/files/mootools_83_snookca.png",
  function(width, height) { alert(width + 'px ' + height + 'px') }
);
Posted by: Guest on January-25-2020
0

javascript get width of image

image.width
Posted by: Guest on July-01-2020

Code answers related to "how to get image size from url in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language