forked from Kak2X/jul
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnumgfx.php
45 lines (36 loc) · 792 Bytes
/
numgfx.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
error_reporting(0);
$n = $_GET['n'];
$l = isset($_GET['l']) ? $_GET['l'] : 1;
$f = $_GET['f'];
$len = strlen($n.'');
if($len < $l) {
$ofs = $l - $len;
$len = $l;
} else {
$ofs = 0;
}
if (!$f) $f = 'numnes';
$gfx = ImageCreateFromPNG("numgfx/$f.png");
$img = ImageCreate($len * 8, 8);
ImageCopy($img, $gfx, 0, 0, 104, 0, 1, 1);
for($i = 0; $i < $len; ++$i) {
switch($n[$i]){
case '/': $d=10; break;
case 'N': $d=11; break;
case 'A': $d=12; break;
case '-': $d=13; break;
default: $d = $n[$i];
}
ImageCopy($img, $gfx, ($i + $ofs) * 8, 0, $d * 8, 0, 8, 8);
}
Header('Content-type:image/png');
if ($f == "numdeath") {
$ctp = 1;
} else {
$ctp = 0;
}
ImageColorTransparent($img,$ctp);
ImagePNG($img);
ImageDestroy($img);
?>