I made this gallery a while ago: https://jsfiddle.net/5e9L09Ly/
Don't worry it won't upload anything.
I made that you can sort by file size, but I want to sort by image resolution. The problem is that not all of the images will have loaded onto the page yet so I won't know what their size will be.
The gallery itself is pretty basic, it asks for a directory and it will then display all the images and videos in that directory.
It only works in chrome right now, just click on browse at the very top. The number before browse is how many images should show or load when you select the directory.
I am not sure how to approach this problem...
One thing I had in mind was something like this:
imgLoad.attr("src", url);
imgLoad.unbind("load");
imgLoad.bind("load", function() {
console.log(url+' size: '+(this.width + this.height));
});
The problem with that is then it loads each and every image it loads and it would put a big strain on the hdd and browser if you have a lot of images, lets say 20k images you are trying to load.
So yeah.... any suggestions would be great.
I won't post the code here because it is too much, please check out the fiddle.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…