gzip compression image

Started on the old forum in March 2010 · view the original in the archive · old links redirect here

No replies · 1,071 views · started 16 years ago · 1 min read

GumSlone Administrator Principal · 1,690 posts #1

you remember the gzip image that i've used at besttop and other my sites which showed the compression percentage?

many wapmasters have cloned it and still are still using it at their sites but results were not as nice as the original.

so here is the original code. (c) gumslone

<?php

$num = $_GET['num'];
$size = imagettfbbox(6, 0, "/fonts/04B_03B.TTF", $num.'%');
$xsize = abs($size[0]) + abs($size[2]);
$x4=29+$xsize;
$im = @ImageCreate ($x4, 11)
      or die ("Kann keinen neuen GD-Bild-Stream erzeugen");
$background_color = ImageColorAllocate ($im, 255, 255, 255);
if ($num>0) $text_color3 = ImageColorAllocate ($im, 100, 230, 50);
 else $text_color3 = ImageColorAllocate ($im, 255, 0, 0);
Imagefilledrectangle ($im, 0, 0, 64, 9, $background_color );
ImageTTFText ($im, 6, 0, 3, 8, $text_color3, "/fonts/04B_03B.TTF","GZIP");
Imageline ($im, 23, 0, 23, 9, $text_color3);
ImageTTFText ($im, 6, 0, 26, 8, $text_color3, "/fonts/04B_03B.TTF",$num.'%');
Imagerectangle ($im, 0, 0, $x4-1, 10, $text_color3);
header('Content-Type: image/PNG');
ImagePNG ($im);
imagedestroy($im);

?>

for the ttf font you can search on google or use your own.

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

Attachments: gzip_image.png gzip_image2.png

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close