daily pastebin goal
62%
SHARE
TWEET

Untitled

a guest Jul 19th, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top