PHP kód:
// height/width
$imginfo = getimagesize($src_file);
$src_w = $imginfo[0];
$src_h = $imginfo[1];
$zoom_h = $max_h / $src_h;
$zoom_w = $max_w / $src_w;
$zoom = min($zoom_h, $zoom_w);
$dst_h = $zoom<1 ? round($src_h*$zoom) : $src_h;
$dst_w = $zoom<1 ? round($src_w*$zoom) : $src_w;
$zoom_h = $max_thumb_h / $src_h;
$zoom_w = $max_thumb_w / $src_w;
$zoom = min($zoom_h, $zoom_w);
$dst_thumb_h = $zoom<1 ? round($src_h*$zoom) : $src_h;
$dst_thumb_w = $zoom<1 ? round($src_w*$zoom) : $src_w;
$dst_img = imagecreatetruecolor($dst_w,$dst_h);
$white = imagecolorallocate($dst_img,255,255,255);
imagefill($dst_img,0,0,$white);
imagecopyresampled($dst_img,$src_img, 0,0,0,0, $dst_w,$dst_h,$src_w,$src_h);
$textcolor = imagecolorallocate($dst_img, 255, 255, 255);
if (isset($tag))
imagestring($dst_img, 5, 5, 5, "$tag", $textcolor);
if($type == 'jpeg'){
$desc_img = $write($dst_img,"$path/$image_name", 75);
}else{
$desc_img = $write($dst_img,"$path/$image_name", 2);
}
$dst_t_img = imagecreatetruecolor($dst_thumb_w,$dst_thumb_h);
$white = imagecolorallocate($dst_img,255,255,255);
imagefill($dst_t_img,0,0,$white);
imagecopyresampled($dst_t_img,$src_img, 0,0,0,0, $dst_thumb_w,$dst_thumb_h,$src_w,$src_h);
$textcolor = imagecolorallocate($dst_t_img, 255, 255, 255);
if (isset($tag))
imagestring($dst_t_img, 2, 2, 2, "$tag", $textcolor);
if($type == 'jpeg'){
$desc_img = $write($dst_t_img,"$path/$thumb_name", 75);
}else{
$desc_img = $write($dst_t_img,"$path/$thumb_name", 2);
}
}
function save_ad($option,$plugins){
global $database,$mosConfig_absolute_path,$mosConfig_mailfrom,$my;
$row = new adsManagerAd($database);
$itemid = intval( mosGetParam( $_GET, 'Itemid', 0 ));
amit ez jelenleg művel az az, hogy a bélyegképre és a normál képre vízjelet tesz, amit én adok meg, a kép felső részére és normál fonttal.
Könyvjelzők