Files
crm.twinpol.com/pic.php

39 lines
1.4 KiB
PHP
Raw Normal View History

2025-05-12 15:44:39 +00:00
<?
$p = $_GET['p'];
$w = $_GET['w'];
$h = $_GET['h'];
$string = $_GET['string'];
$handle = imageCreatefromjpeg($p);$co="jpeg";
if(strstr($p,".jpg") || strstr($p,".jpeg")) {$handle = imageCreatefromjpeg($p);$co="jpeg";}
if(strstr($p,".gif")){$handle = imageCreatefromgif($p);$co="gif";}
if(strstr($p,".png")){$handle = imageCreatefrompng($p);$co="png";}
if($co=="jpeg")header("Content-type: image/jpeg");
if($co=="gif")header("Content-type: image/gif");
if($co=="png")header("Content-type: image/png");
$ow = imagesx($handle);
$oh = imagesy($handle);
/*
$imd = imagecreatetruecolor($w,$h);
imagecopyresized($imd,$ims,0,0,0,0,$w,$h,$ow,$oh);
*/
$black_picture = imageCreatetruecolor($w,$h);
imagefill($black_picture,0,0,imagecolorallocate($black_picture, 255, 255, 255));
imagecopyresampled($black_picture, $handle, 0, 0, 0, 0,$w, $h, $ow, $oh);
if($_GET['string']!="" && !@imagejpeg($black_picture,$dest_pict.'/mini_'.$pict, $size_in_pixel)){
$bg = imagecolorallocate($black_picture,0,0,255);
imagefilledrectangle($black_picture,0,$h-20,$w,$w,$bg);
imagestring($black_picture, 4, 10, $h-18, $_GET['string'],imagecolorallocate($black_picture,255,255,255));
}
imagejpeg($black_picture,'', '85');
imagedestroy($handle);
imagedestroy($black_picture);
/*
if($co=="jpeg"){header("Content-type: image/jpeg");imagejpeg($imd);}
if($co=="gif"){header("Content-type: image/jpeg");imagegif($imd);}
if($co=="png"){header("Content-type: image/png");imagepng($imd);}
*/
?>