One Hat Cyber Team
Your IP :
216.73.216.135
Server IP :
194.44.31.54
Server :
Linux zen.imath.kiev.ua 4.18.0-553.77.1.el8_10.x86_64 #1 SMP Fri Oct 3 14:30:23 UTC 2025 x86_64
Server Software :
Apache/2.4.37 (Rocky Linux) OpenSSL/1.1.1k
PHP Version :
5.6.40
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
mellit
/
public_html
/
test-formeditor
/
View File Name :
imagemaker.php
<?php function getStringSize($size, $str, $font) { $height = 0; $width = 0; $tok = strtok($str,"\n"); while ($tok) { $bbox = imagettfbbox($size, 0, $font, $tok); $height += ($bbox[3]-$bbox[7])*1.5; $width = max($width, $bbox[2]-$bbox[6]); $tok = strtok("\n"); } return array($width, $height); } function getBestSize($str, $width, $height, $font) { $size = 8; for($i = 0; $i<10; $i++) { $s = 8+$i*2; $bb = getStringSize($s, $str, $font); if($bb[0]>$width || $bb[1]>$height) { break; } $size = $s; } return $size; } function printText($im, $str, $x0, $y0, $width, $height, $color, $font) { global $font; $size = getBestSize($str, $width, $height, $font); $dim = getStringSize($size, $str, $font); $x = $x0 + max(0, ($width - $dim[0])/2); $y = $y0 + max(0, ($height - $dim[1])/2); $tok = strtok($str,"\n"); while ($tok) { $bbox = imagettfbbox($size, 0, $font, $tok); $x1 = $x-$bbox[6]; $y1 = $y-$bbox[7] + ($bbox[3]-$bbox[7])/4; imagettftext($im, $size, 0, $x1, $y1, $color, $font, $tok); $y += ($bbox[3]-$bbox[7])*1.5; $tok = strtok("\n"); } } function makeImage($font, $filename) { $width0 = $_REQUEST["sx"]; $height0 = $_REQUEST["sy"]; $im = imagecreate($width0, $height0); $black = imagecolorallocate($im, 0, 0, 0); $white = imagecolorallocate($im, 255, 255, 255); $grey = imagecolorallocate($im, 192, 192, 192); imagefilledrectangle($im, 0, 0, $width0-1, $height0-1, $white); $pnum = $_REQUEST["pnum"]; for($i = 0; $i<$pnum; $i++) { $x = $_REQUEST["px".$i]; $y = $_REQUEST["py".$i]; $width = $_REQUEST["pwidth".$i]; $height = $_REQUEST["pheight".$i]; $type = $_REQUEST["ptype".$i]; $text = $_REQUEST["ptext".$i]; if($type=="rectangle") { imagefilledrectangle($im, $x, $y, $x+$width-1, $y+$height-1, $grey); imagerectangle($im, $x, $y, $x+$width-1, $y+$height-1, $black); } else if($type=="ellipse") { imagefilledellipse($im, $x+$width/2, $y+$height/2, $width, $height, $grey); imageellipse($im, $x+$width/2, $y+$height/2, $width, $height, $black); $newheight = $width/sqrt(2); $newwidth = $width/sqrt(2); $x += ($width-$newwidth)/2; $y += ($height-$newheight)/2; $width = $newwidth; $height = $newheight; } $x += 2; $y += 2; $width -= 4; $height -= 4; printText($im, $text, $x, $y, $width, $height, $black, $font); } imagerectangle($im, 0, 0, $width0-1, $height0-1, $black); imagepng($im, $filename); imagedestroy($im); } ?>