How to get original image size in JavaScript?

Posted by Pinki | Updated on

Answer: Use the HTML5 naturalWidth and naturalHeight

Are you searching for how to get original image size (width & height) in JavaScript? Use the following JavaScript code the get original image width and height.

Example 1. Get original image size in JavaScript

Example 2. Get original image size in JavaScript


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers