image-rotate
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?
//--- define image
$image = "./watermerk.jpg";
if ($_GET['rotate'])
{
header('content-type: image/jpeg');
$image = imagecreatefromjpeg($image);
$image = imagerotate($image, $_GET['rotate'], 0);
imagejpeg($image);
}
else
{
echo "<p><img src=\"" . $image . "\" alt=\"\" /></p>";
echo "<p>Rotate: <a href=\"" . $_SERVER['PHP_SELF'] . "?rotate=90\" title=\"Rotate 90 °\">90°</a> links<br />";
echo "Rotate: <a href=\"" . $_SERVER['PHP_SELF'] . "?rotate=270\" title=\"Rotate 90 °\">90°</a> rechts</p>";
echo "<p>Rotate: <a href=\"" . $_SERVER['PHP_SELF'] . "?rotate=180\" title=\"\">180</a></p>";
}
?>
//--- define image
$image = "./watermerk.jpg";
if ($_GET['rotate'])
{
header('content-type: image/jpeg');
$image = imagecreatefromjpeg($image);
$image = imagerotate($image, $_GET['rotate'], 0);
imagejpeg($image);
}
else
{
echo "<p><img src=\"" . $image . "\" alt=\"\" /></p>";
echo "<p>Rotate: <a href=\"" . $_SERVER['PHP_SELF'] . "?rotate=90\" title=\"Rotate 90 °\">90°</a> links<br />";
echo "Rotate: <a href=\"" . $_SERVER['PHP_SELF'] . "?rotate=270\" title=\"Rotate 90 °\">90°</a> rechts</p>";
echo "<p>Rotate: <a href=\"" . $_SERVER['PHP_SELF'] . "?rotate=180\" title=\"\">180</a></p>";
}
?>