Post Reply 
Icon/Link instead of LARGE image ?
Jun. 24, 2009, 10:29 PM (This post was last modified: Jun. 24, 2009 10:30 PM by Toppy.)
Post: #1
Icon/Link instead of LARGE image ?
Hi,

I currently use the following Header filter to block .gif images over 600KB in size.

Code:
[Headers]
In = TRUE
Out = FALSE
Key = "Content-Type: 5d Kill large GIF Images over 600KB (In)"
URL = "$TST(volat=*.clength:[#614400:*].*)&$URL(^[^.]+.deviantart.com)"
Match = "image/gif"
Replace = "\k"

This filter kills ANY gif file over 600KB (except on deviantart.com)

.... Now I thought if it would be possible to make it a little more user-friendly, so instead of just killing it, it could place a little icon (or link/...) in place, so the user knows there is a large .gif file filtered. Clicking the icon would bring the .gif file alive (load it, and show it where it belongs).

Now, should that still be possible using a header filter, or should that be possible using a regular filter.

Perhaps I bug people with this request, but it could actually be quite usuable for a lot of people with slow internet or those who pay per traffic.
Especially on forums where lots of screenshots are posted, or specific blogs, where people post many unoptimized images ? (thinking about .BMP files also).

I don't ask if someone is willing to do the dirty work for me, but perhaps some tips on how to start (header/regular filter) and code on how to render the image in the page when the icon/text is clicked.

Many thanks in advance for all helpful members.Smile!
Add Thank You Quote this message in a reply
Jun. 24, 2009, 10:51 PM
Post: #2
RE: Icon/Link instead of LARGE image ?
this is a slightly different method than i use (i hate large images also), but maybe this is what you have in mind - http://prxbx.com/forums/showthread.php?t...39#pid8339
Add Thank You Quote this message in a reply
Jun. 24, 2009, 11:11 PM
Post: #3
RE: Icon/Link instead of LARGE image ?
(Jun. 24, 2009 10:51 PM)ProxRocks Wrote:  this is a slightly different method than i use (i hate large images also), but maybe this is what you have in mind - http://prxbx.com/forums/showthread.php?t...39#pid8339

Hmmm, Thanks ProxRocks,
It seems to make use of blocklists specifically for this filter, meaning you need to have the thumbnails on your system, also, I think it could break (a lot of) Sidki's filters. I would rather like to brew something that makes the browser only request the image when the users choose to do so.
Anyway, I'll try to get something working, but remember, I haven't got the talents for making good proxo-, html-, dhtml recipes.
Add Thank You Quote this message in a reply
Jun. 25, 2009, 06:05 AM
Post: #4
RE: Icon/Link instead of LARGE image ?
Does that mean that you like .jpg and .png images, but just dislike .gif images? Why?
Add Thank You Quote this message in a reply
Jun. 25, 2009, 08:05 AM
Post: #5
RE: Icon/Link instead of LARGE image ?
(Jun. 24, 2009 10:29 PM)Toppy Wrote:  Now I thought if it would be possible to make it a little more user-friendly, so instead of just killing it, it could place a little icon (or link/...) in place, so the user knows there is a large .gif file filtered. Clicking the icon would bring the .gif file alive (load it, and show it where it belongs).
Check out this.

You may need to replace killed.gif with other icon you like.

btw, I wish z12 had recovered from his sickness.
Add Thank You Quote this message in a reply
Jun. 26, 2009, 02:24 PM
Post: #6
RE: Icon/Link instead of LARGE image ?
(Jun. 25, 2009 08:05 AM)whenever Wrote:  
(Jun. 24, 2009 10:29 PM)Toppy Wrote:  Now I thought if it would be possible to make it a little more user-friendly, so instead of just killing it, it could place a little icon (or link/...) in place, so the user knows there is a large .gif file filtered. Clicking the icon would bring the .gif file alive (load it, and show it where it belongs).
Check out this.

You may need to replace killed.gif with other icon you like.

btw, I wish z12 had recovered from his sickness.
Thanks, but that's merely the same solution as the filter posted above.

@Siamese Cat,

No, I hate them all ! Sinister
Nope, the .gif extension was just as an example.
Add Thank You Quote this message in a reply
Jun. 26, 2009, 02:35 PM (This post was last modified: Jun. 26, 2009 02:36 PM by ProxRocks.)
Post: #7
RE: Icon/Link instead of LARGE image ?
this is what i use:
Code:
Name = "Block & Fetch: Blacklisted Images {PFR 1.15.07}"
Active = TRUE
URL = "$TST(hCT=*html)(^$TST(keyword=*.b_img_src.*))"
Bounds = "<img\s*>"
Limit = 1024
Match = "<img*src=($AV(*$LST(IMG_SRC)*))\1\2>"
        "$TST(($GET(pIimg)+)=$LST(Count)|*)$SET(pIimg=$GET(i))$SET(tIimg=)"
Replace = "<span class=Prox style=display:none;>"
          "<span class=ProxI_$DTM(c)_$GET(pIimg)&#x20;ProxToggle style=display:inline>"
          "<a class=ProxToggle&#x20;ProxTogO-A"
          " href="javascript:prxO.oInt.inToggleB('ProxI_$DTM(c)_$GET(pIimg)','cl','span');"
          "var prxIimg;prxIimg=document.getElementById('proxII_$DTM(c)_$GET(pIimg)');"
          "prxIimg.src=prxIimg.longDesc;"
          "void(prxIimg.style.display='inline');""
          " target=_self>Fetch</a>"
          "<a class=ProxToggle&#x20;ProxTogO-A href=\1 target=_top>Blacklisted Image</a>"
          "</span>"
          "<img id="proxII_$DTM(c)_$GET(pIimg)" style="display:none;" src="about:blank" longdesc=\1\2>"
          "</span>"

Name = "Block & Fetch: Blacklisted Background Images - td {PFR 1.15.07}"
Active = TRUE
URL = "$TST(hCT=*html)(^$TST(keyword=*.b_img_src.*))"
Bounds = "<td\s*>"
Limit = 1024
Match = "<\3background=($AV(*$LST(IMG_SRC)*))\1\2>"
        "$TST(($GET(pIimg)+)=$LST(Count)|*)$SET(pIimg=$GET(i))$SET(tIimg=)"
Replace = "<span class=Prox style=display:none;>"
          "<span class=ProxI_$DTM(c)_$GET(pIimg)&#x20;ProxToggle style=display:inline>"
          "<a class=ProxToggle&#x20;ProxTogO-A"
          " href="javascript:prxO.oInt.inToggleB('ProxI_$DTM(c)_$GET(pIimg)','cl','span');"
          "var prxIimg;prxIimg=document.getElementById('proxII_$DTM(c)_$GET(pIimg)');"
          "prxIimg.src=prxIimg.longDesc;"
          "void(prxIimg.style.display='inline');""
          " target=_self>Fetch</a>"
          "<a class=ProxToggle&#x20;ProxTogO-A href=\1 target=_top>Blacklisted Background Image</a>"
          "</span>"
          "<img id="proxII_$DTM(c)_$GET(pIimg)" style="display:none;" src="about:blank" longdesc=\1\2>"
          "</span>"

edit: note that it requires a maintained list of what i want blocked though...
Add Thank You Quote this message in a reply
Jun. 27, 2009, 03:42 AM
Post: #8
RE: Icon/Link instead of LARGE image ?
(Jun. 26, 2009 02:24 PM)Toppy Wrote:  Thanks, but that's merely the same solution as the filter posted above.
I really hope you had read that post carefully, unless I'm misunderstanding what you want.
Add Thank You Quote this message in a reply
Jun. 27, 2009, 08:35 AM (This post was last modified: Jun. 27, 2009 08:39 AM by lnminente.)
Post: #9
RE: Icon/Link instead of LARGE image ?
Hi, Toppy i am too ociously busy these days (all the day walking out with friends, and now i go to camping for some days). But i believe what you need is to redirect the image files to a killed.html with the info to bypass (base config)

I don't have time to test if the browser will show you the html page like an iframe when it is waiting for a image. But i post you what you need to test it:

Code:
$JUMP(http://local.ptron/base/killed.html\?WHY=$ESC(ImageBiggerThan600KB)&URL=$ESC(\u))


Attached File(s)
.txt  killed.html.txt (Size: 1.57 KB / Downloads: 712)
Add Thank You Quote this message in a reply
Jun. 29, 2009, 11:40 AM (This post was last modified: Jun. 29, 2009 11:45 AM by lnminente.)
Post: #10
RE: Icon/Link instead of LARGE image ?
Code:
[HTTP headers]
In = TRUE
Out = FALSE
Key = "! :I_53 Kill images by length {ln}090629 TEST"
Match = "$IHDR(Content-Length:  ?*&\0) $TST(\0=([#600000:*])\2) $IHDR(Content-Type: image/*)"
Replace = "$LOG(wHeader $DTM(c),! :I_53 Kill images by length ($GET(ContentType): \2 bytes) in \u) $JUMP(http://local.ptron/base/killed.html\?WHY=$ESC(ImageBiggerThan600KB)&URL=$ESC(\u))"

http://www.juegosyolimpicos.com/wp-conte...pretty.jpg

Don't have tested if works with images inline in a web page.

The bypass method used in the killed.html is the one i use in the base config, adapt it to the one of the config you use.
Add Thank You Quote this message in a reply
Jun. 29, 2009, 04:36 PM (This post was last modified: Jun. 29, 2009 04:40 PM by lnminente.)
Post: #11
RE: Icon/Link instead of LARGE image ?
(Jun. 29, 2009 11:40 AM)lnminente Wrote:  Don't have tested if works with images inline in a web page.

As spected, the browser doesn't render killed.html as an iframe when it is waiting for an inline image inside a web page. So it shows a broken image instead. Tested in Firefox 3.5 RC3

A web filter can't be used because it should need the size of the image file, wich is sent in the HTTP header. Maybe could be done injecting some javascript or ajax thing, probably, I don't know...
Add Thank You Quote this message in a reply
Post Reply 


Forum Jump: