Before uploading an image to the server, I need to validate its dimensions on the client side. I have searched for solutions using img.Onload(), but that's not what I am looking for.
All I want is for the user to choose the image from
<input id="selectThumb" name="myImage" type="file"
accept="image/*" onchange="angular.element(this).scope().fileName(this)"
</input>
After selecting the file, only the name should be displayed, and an alert should pop up if the image is larger than 172X152px. I don't need to preview the image.
The "fileName(this)" function provides me with the image file's name, but I can't access its dimensions to validate them. For your information, I have defined this function in my directive.
To reiterate, I aim to display an alert when a user selects a file that exceeds the size limit of 172X152px. There will be no image preview or loading on my page.