File size: 1.7Kb
<?
//Error_Reporting(E_ALL & ~E_NOTICE);
header("Cache-Control: no-cache");
include("func.php");
include("set.php");
include("start.php");
$did=security($did);
$fid=security($fid);
if(file_exists("$dir_load/$did/$fid.img")) $fid_s="$dir_load/$did/$fid.img";
elseif(file_exists("$dir_screen/$did/$fid.jpg")) $fid_s="$dir_screen/$did/$fid.jpg";
elseif(file_exists("$dir_screen/$did/$fid.gif")) $fid_s="$dir_screen/$did/$fid.gif";
elseif(file_exists("$dir_screen/$did/$fid.png")) $fid_s="$dir_screen/$did/$fid.png";
else $fid_s="";
if(file_exists("$dir_load/$did/$fid") && $fid_s!="")
{
$rsh=rsh($fid_s);
$data_img = base64_encode(file_get_contents("$fid_s"));
$data_img = base64_decode($data_img);
$img=imageCreateFromString($data_img);
$mark=imageCreateFromPNG("img/marker.png");
$mx=ImageSX($mark);
$my=ImageSY($mark);
$w=ImageSX($img);
$h=ImageSY($img);
if($w<=96) $r=8;
elseif($w>96 && $w<101) $r=8;
elseif($w>=101 && $w<128) $r=9;
elseif($w>=128 && $w<176) $r=10;
elseif($w>=176 && $w<240) $r=11;
elseif($w>=240 && $w<320) $r=12;
elseif($w>320) $r=15;
$color=imagecolorallocate($img,$set_copr_color[0],$set_copr_color[1],$set_copr_color[2]);
if($on_marker) imageCopy($img,$mark,0,0,0,0,$mx,$my); else imagettftext($img, $r, 0, 2, $h-5, $color, "img/comicbd.ttf","$set_copr");
Header("Content-type: image/jpeg");
imageJPEG($img);
imageDestroy($img);
}
else
{
$img=imageCreate(80,30);
$blc=imagecolorallocate($img,0,0,0);
$red=imagecolorallocate($img,255,0,0);
imagettftext($img, 10, 0, 10, 10, $red, "img/comicbd.ttf","Not Found");
Header("Content-type: image/png");
imagepng($img);
imageDestroy($img);
}
?>