Guest User

Untitled

a guest
Jul 19th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. function std_img_search()
  2. {
  3. $("img").each( function () {
  4. //get the aspect ratios
  5. src =$(this).attr("src");
  6. var h = 0;
  7. var w = 0;
  8. //for each image, get their height and width
  9. $('body').append($('<img src="' + src + '" style="display:none" />').load(function() {h = $(this).height(); w = $(this).width(); $(this).remove();}));
  10. ar = h/w;
  11. //if the ration is > 1:3 and less than 3:1, we keep it
  12. if(ar > .33 && ar < 3 && h >= 100 && w >= 100)
  13. {
  14. img_arr.push(src);
  15. }
  16. });
  17. }
Add Comment
Please, Sign In to add comment