Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function std_img_search()
- {
- $("img").each( function () {
- //get the aspect ratios
- src =$(this).attr("src");
- var h = 0;
- var w = 0;
- //for each image, get their height and width
- $('body').append($('<img src="' + src + '" style="display:none" />').load(function() {h = $(this).height(); w = $(this).width(); $(this).remove();}));
- ar = h/w;
- //if the ration is > 1:3 and less than 3:1, we keep it
- if(ar > .33 && ar < 3 && h >= 100 && w >= 100)
- {
- img_arr.push(src);
- }
- });
- }
Add Comment
Please, Sign In to add comment