Search code examples
javascriptimagegifdimension

How to get size of gif image in JavaScript


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.

Getting Duration of Gif Image in JavaScript


Solution

  •  const img = new Image();
     img.onload = function() {
     alert(this.width + 'x' + this.height);
     }
     img.src ='your image path here';