PDA

View Full Version : jQuery How do you locally load an image and check its dimensions?


Apothem
06-09-2010, 07:24 AM
How do I use jQuery (or ordinary JS) to:
Allow someone to "Attach" an image and have it loaded + check the dimensions of it WITHOUT submitting the image to the server.
AND
Allow someone to paste/type in an image URL + have it loaded + check the dimensions of it?

What I want to do is allow someone to try to upload an image only on the condition that their local/remote file fits a certain dimension... but I don't want to have it submitted to my server until that condition has been validated via the user's JS/jQuery.

Fumigator
06-09-2010, 03:51 PM
That's really not possible. Where would this file load, if not to your server? I secretly hope someone else comes along and says "Actually you can do this! I did it by doing such and such". We can always dream :D

roosny
06-24-2010, 06:18 PM
Its quite a task to do so but all i can recommend is virtualization of your site to create a virtual web server that will load when checking dimension but at now you cant do the task.