Post Reply 
Another Filtering Proxy
Dec. 05, 2014, 09:05 AM (This post was last modified: Dec. 05, 2014 02:56 PM by GunGunGun.)
Post: #10
RE: Another Filtering Proxy
(Dec. 05, 2014 08:36 AM)whenever Wrote:  I think it doesn't exist a way like that. That's why major Ad blocking software like ABP or Privoxy have to maintain a blacklist for blocking.

After some tests I finally figured that image cannot get blocked if it is not fully downloaded, partial download will show image as 0x0 resolution. I try to download the image with my browser: http://upload.wikimedia.org/wikipedia/co...ck_big.jpg
And ESC to stop download, View image info and image size is 0x0, so i think yes, no way.


Edit: Oh no, seem my above test is wrong, I tried to download that image with my Browser, and Pause download and after I Open the image with window image viewer, It show the image with correct width and height but it still not fully downloaded yet.

http://i.imgur.com/0TONiBe.png

10109x4542 but I only download 154KB from that image: http://i.imgur.com/aPGfz41.png

Maybe it is possible ? If we can then I think we can use argothirm something like this: Download a part of an image first, and then try to use OS API to detect image width/height, if match then block, if not match then download full image and send to browser.


Update: GDI Library can get image size, I tested and worked, great! Here is my test, please try it Big Teeth So much hype at this time! This may open a new future for AdBlock software because we can block ad much more effective!

https://app.box.com/s/gtat69ntsdqksrcoy9sg

I included source code inside that archive. I think I will request Privoxy's author add this feature, I think it is possible. And I think clearly Python do get image size too, because there is lots of way to call OS API: http://www.google.com/search?q=get+image...e=0&nord=1

Update2: Holy cow, it is so simple and POSSIBLE for SURE, we can did that from a long time ago: http://php.net/manual/en/function.getima....php#88793

Quote:As noted below, getimagesize will download the entire image before it checks for the requested information. This is extremely slow on large images that are accessed remotely. Since the width/height is in the first few bytes of the file, there is no need to download the entire file. I wrote a function to get the size of a JPEG by streaming bytes until the proper data is found to report the width and height:
And demo using CURL PHP:
http://stackoverflow.com/a/7476094/3763937
Quote:I managed to answer my own question and I've included the PHP code snippet.

The only downside (for me at least) is that this writes the partial image download to the file-system prior to reading in the dimensions with getImageSize.

For me 10240 bytes is the safe limit to check for jpg images that were 200 to 400K in size.

Seem very exciting. What we will achieve if we can block image based on width height ?
- Reliable banner blocking method.
- Kill all webbugs that is 0x0 or 1x1 or 2x2, web developer use webbugs to track us, and almost no way to block them all.

UPDATE3: Works on PNG too, I will report gif later, test: http://groups.csail.mit.edu/graphics/cla...MapBig.png

Update4: WORKS ON GIF TOO! Big Teeth, test: http://www.physics.usyd.edu.au/~gekko/wr...8_2620.gif

What I've done, Google "big image" "big image "png"" "big image "gif"".


Fully download image and then detect image's width/height is not effective because it waste bandwidth but acceptable I think, because still better than display an gif banner that increase browser resource. I think OS API will allow us to detect image width and height after it get fully downloaded

Quote: + Parse Privoxy actions files (default.action, user.action) for URL blocking
Thank you very much, very nice!
Add Thank You Quote this message in a reply
Post Reply 


Messages In This Thread
Another Filtering Proxy - whenever - Nov. 22, 2014, 09:35 AM
RE: Another Filtering Proxy - whenever - Nov. 29, 2014, 11:24 AM
RE: Another Filtering Proxy - GunGunGun - Nov. 29, 2014, 02:15 PM
RE: Another Filtering Proxy - whenever - Nov. 30, 2014, 12:35 PM
RE: Another Filtering Proxy - GunGunGun - Dec. 03, 2014, 09:07 PM
RE: Another Filtering Proxy - whenever - Dec. 04, 2014, 01:09 AM
RE: Another Filtering Proxy - GunGunGun - Dec. 04, 2014, 02:33 AM
RE: Another Filtering Proxy - GunGunGun - Dec. 04, 2014, 03:27 PM
RE: Another Filtering Proxy - whenever - Dec. 05, 2014, 08:36 AM
RE: Another Filtering Proxy - GunGunGun - Dec. 05, 2014 09:05 AM
RE: Another Filtering Proxy - whenever - Dec. 08, 2014, 03:30 AM
RE: Another Filtering Proxy - GunGunGun - Dec. 08, 2014, 09:09 AM
RE: Another Filtering Proxy - whenever - Dec. 08, 2014, 12:11 PM
RE: Another Filtering Proxy - whenever - Dec. 28, 2014, 10:50 AM
RE: Another Filtering Proxy - cattleyavns - May. 26, 2015, 06:22 AM
RE: Another Filtering Proxy - whenever - May. 27, 2015, 02:26 PM
RE: Another Filtering Proxy - cattleyavns - May. 28, 2015, 04:26 AM
RE: Another Filtering Proxy - whenever - May. 28, 2015, 09:53 AM
RE: Another Filtering Proxy - cattleyavns - May. 29, 2015, 04:07 AM
RE: Another Filtering Proxy - whenever - Jun. 03, 2015, 07:56 AM
RE: Another Filtering Proxy - cattleyavns - Jun. 05, 2015, 12:26 PM
RE: Another Filtering Proxy - whenever - Jul. 19, 2015, 07:32 AM
RE: Another Filtering Proxy - cattleyavns - Jul. 19, 2015, 05:53 PM
RE: Another Filtering Proxy - cattleyavns - Jun. 17, 2015, 09:14 AM
RE: Another Filtering Proxy - cattleyavns - Jul. 01, 2015, 08:55 AM
RE: Another Filtering Proxy - whenever - Jul. 20, 2015, 03:31 AM
RE: Another Filtering Proxy - cattleyavns - Jul. 20, 2015, 06:17 AM
RE: Another Filtering Proxy - cattleyavns - Jan. 05, 2016, 04:53 PM
RE: Another Filtering Proxy - whenever - Jan. 06, 2016, 08:44 AM
RE: Another Filtering Proxy - cattleyavns - Jan. 06, 2016, 07:40 PM
RE: Another Filtering Proxy - whenever - Jan. 07, 2016, 02:25 AM
RE: Another Filtering Proxy - cattleyavns - Jan. 07, 2016, 08:41 AM
RE: Another Filtering Proxy - cattleyavns - Jan. 10, 2016, 07:27 AM
RE: Another Filtering Proxy - cattleyavns - Jan. 25, 2016, 04:37 PM
RE: Another Filtering Proxy - whenever - May. 16, 2016, 08:42 AM

Forum Jump: