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
| <?php
header("Content-type: image/jpeg");
$image = str_replace('.', '', $_GET['image']);
if ($image != "blank" && file_exists("./images/eclate/" . $image . ".jpg")) {
$x1 = $_GET['x10'];
$y1 = $_GET['y10'];
$xm = $_GET['xm0'];
$ym = $_GET['ym0'];
$x2 = $_GET['x20'];
$y2 = $_GET['y20'];
$chemin = "./images/eclate/" . $image . ".jpg";
$im = imagecreatefromjpeg($chemin);
$noir = imagecolorallocate($im, 0, 0, 0);
imageline($im, $x1, $y1, $xm, $ym, $noir);
imageline($im, $xm, $ym, $x2, $y2, $noir);
imagejpeg($im);
} else {
$chemin = "./images/eclate/blank.jpg";
$im = imagecreatefromjpeg($chemin);
imagejpeg($im);
}
?> |