javascript get image width and height
var img = new Image();
img.onload = function() {
alert(this.width + 'x' + this.height);
}
img.src = 'http://www.google.com/intl/en_ALL/images/logo.gif';
javascript get image width and height
var img = new Image();
img.onload = function() {
alert(this.width + 'x' + this.height);
}
img.src = 'http://www.google.com/intl/en_ALL/images/logo.gif';
get image file width javascript
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Get image width using File API</title>
</head>
<body>
<input type='file' onchange="readURL(this);" />
<script>
function readURL(input) {
if (input.files && input.files[0]) {
var reader = new FileReader();
reader.onload = function (e) {
var img = new Image;
img.onload = function() {
console.log("The width of the image is " + img.width + "px.");
};
img.src = reader.result;
};
reader.readAsDataURL(input.files[0]);
}
}
</script>
</body>
</html>
javascript get image dimensions
var img = document.getElementById("myImageID");
var imgWidth = img.clientWidth;
var imgHeight = img.clientHeight;
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us