Checking Image height and width during upload
Posted on 2005-05-02
I am using Struts to upload an image. I am able to access the FormFile object and store it into the database.
However, before uploading the image, I would like to examine the image being uploaded to make sure that it is a certain dimension. If it is not, I would like to issue an error message asking the user to re-upload a correct image. How would I do this?
Taking this a step further, would it be possible to automatically resize the image when inserting it into the database? Either solution is fine. Could someone please give me an example of how this can be accomplished.