The Un-Official Proxomitron Forum

Full Version: [Req]image size limit
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Is it possible for proxomitron to only load images that its size is lower than a specific limit, or only load the image until a specific size is reached.
this will help speed loading pages that contains uncompressed images or large size images.
if its possible i would like to request the filter code for this process.
and define the filter for every format.
for example:
if the image is jpg---dont load images over 100KB or stop loading the image when 100KB is downloaded.
if the image is png---dont load images over 300KB or stop loading the image when 300KB is downloaded.

I am not expert in any programming language or proxomitron advance settings so i hope someone with experience would help me.
thanks in advance.
here's one that blocks an image if it is above a pre-set size...
Code:
In = TRUE
Out = FALSE
Key = "Content-Type: 5d Kill Large Images (In) [add]"
URL = "$TST(volat=*.clength:[#100000:*].*)"
Match = "image/"
Replace = "\k"
Here's a generic header filter that kills by type/size:

Code:
[HTTP headers]
In = TRUE
Out = FALSE
Key = "Zap-Image: Kill Big Images (In)"
URL = "$RESP(2)(^local.ptron)"
Match = "(^?)$IHDR(Content-Length: ?*&\0)$IHDR(Content-Type: image/$LST(ImgSize))"
Replace = "Image to Big \k$RDIR(http://local.ptron/killed.gif)"

Here's the contents of $LST(ImgSize) used in the above filter:
Code:
#

png        $TST(\0=[#300000:*])
jpeg        $TST(\0=[#100000:*])

#
Add/Modify list entries as required.

HTH
z12
thank you all

how can i add a link to the replaced image which refere to the original image.
Here's a modified version that works with Firefox/2.0.0.16.
Not sure about other browsers.

Mouse over the image, right click, then click "View Image".
The image will still be blank (or your $REDIR() image).
Hold down the "v" key, then reload the image.
The image should appear.
If not, hold down the shift key while reloading.

It's a bit cumbersome, but off the top of my head, that's all I got.

Code:
[HTTP headers]
In = TRUE
Out = FALSE
Key = "Zap-Image: Kill Big Images (In)"
URL = "(^$KEYCHK(v))$RESP(2)(^local.ptron)"
Match = "(^?)$IHDR(Content-Length: ?*&\0)$IHDR(Content-Type: image/$LST(ImgSize))"
Replace = "Image to Big \k$RDIR(http://local.ptron/killed.gif)"

z12
Reference URL's