How to get Height and Width of an image using java script :client side validation

      Validate Image height and width before uploading

----------------------------------------------------------------------------------
/*
   <script language="javascript">

        function getWidth()

        {

            var testImage = document.getElementById('testImage');

            alert(testImage.clientWidth);

        }

        function getHeight()

        {

            var testImage = document.getElementById('testImage');

            alert(testImage.clientHeight);

        }

        </script>
*/

// HTML code

<!---

<BODY>

        <input type="file" id="testImage" value="browse"/>

        <input type="button" value="get Width" onclick="getWidth()"/>

        <input type="button" value="get Height" onclick="getHeight()"/>

    </BODY>

--->
------------------------------------------------------------------------------------------

Comments

Popular posts from this blog

Struts 2 : Warning :No configuration found for the specified action: 'Login.action' in namespace: '/'

Upload csv file at Google Cloud Storage using java

Read Images from a xlsx file using Apache POI