I looked into this a bit more and have discovered that although it looks like it might have some problems, your code could work, there's just not enough of it there to know for sure. I found this page:
http://www.html5rocks.com/en/tutorials/file/dndfiles/
That shows what can be done. I even used one of its demos to make up a more elaborate demo:
http://home.comcast.net/~jscheuer1/s...ile/images.htm
Requires later versions of browsers, ones that support the File Object. That's almost any current version browser including IE 10, but not IE 9 or less. Multiple files can be processed at once. You can click on the thumbnail(s) to pop up a new window with a larger (if the image itself is larger than the thumb) version of the image.
The method I had in mind using just the Image Object doesn't seem workable for files on the user's own computer, not unless they upload them first.
And I discovered that, even with the File Object method, even though the image is already on the user's computed, it still has to load into the browser to get the width and height. It might even have to load twice. That's because the File Object works by loading the file into memory, and to get the width and height, the file data then has to be loaded into a new Image. IE can actually get the width and height sooner than onload of the new Image, but others do not. And there's no easy way I can see (perhaps no way) to get IE to stop loading the new Image once it has its dimensions. IE has to at least start loading it to get the dimensions.
Bookmarks