Is there any way to determine width and height of gif image with JavaScript. I have no google result of this. Please let me solve the problem. It's related to this post.
Asked
Active
Viewed 376 times
1
-
2Does this answer your question? [How to get image size (height & width) using JavaScript?](https://stackoverflow.com/questions/623172/how-to-get-image-size-height-width-using-javascript) – Justinas Oct 15 '21 at 08:54
1 Answers
4
const img = new Image();
img.onload = function() {
alert(this.width + 'x' + this.height);
}
img.src ='your image path here';

Ahmed amin shahin
- 857
- 6
- 15
-
3
-
2While this code may answer the question, providing additional context regarding how and/or why it solves the problem would improve the answer's long-term value. You can find more information on how to write good answers in the help center: https://stackoverflow.com/help/how-to-answer . Good luck – nima Oct 16 '21 at 12:51
-
2