hmm ich hab jetzt schon einige scripte gefunden
unter anderem dieses hier:
PHP-Code:
<?php
// Copyright by A. Suter - You can remove this line
/////////////////////////////
// Configuration, Settings //
/////////////////////////////
$f1 = $_GET["f1"]; // Filename of the background image
$f2 = $_GET["f2"]; // Filename of the watermark image
$t = $_GET["t"]; // Transparent color for the watermark image
$align = $_GET["align"]; // Horizontal alignment (left, center, right)
$valign = $_GET["valign"]; // Vertical alignment (top, middle, bottom)
$alpha = $_GET["alpha"]; // Alpha blending of the watermark
/* Set default values */
$alpha = (($alpha=="")?80:$alpha);
/////////////////////////////
// Header sendings //
/////////////////////////////
/* Avoid caching the histogram */
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
/* Ensure the returned bytes are interpreted as jpeg-image */
header("Content-type: image/jpeg");
/////////////////////////////
// Script //
/////////////////////////////
/* Open images and get their dimensions */
$im1 = imagecreatefromjpeg($f1);
$im2 = imagecreatefrompng($f2);
$s1 = getimagesize($f1);
$s2 = getimagesize($f2);
if ( $t != "" )
{
/* Check whether the watermark is truecolor or not */
if ( imageistruecolor($im2) )
$col = imagecolorallocate($im2, hexdec(substr($t,0,2)), hexdec(substr($t,2,2)), hexdec(substr($t,4,2)));
else
$col = imagecolorexact($im2, hexdec(substr($t,0,2)), hexdec(substr($t,2,2)), hexdec(substr($t,4,2)));
/* Set the transparent color */
imagecolortransparent($im2, $col);
}
/* Get the position of the watermark */
if ( $align == "left" ) $x = 0;
elseif ( $align == "right" ) $x = $s1[0] - $s2[0];
else $x = ($s1[0] - $s2[0]) / 2;
if ( $valign == "top" ) $y = 0;
elseif ( $valign == "bottom" ) $y = $s1[1] - $s2[1];
else $y = ($s1[1] - $s2[1]) / 2;
/* Copy and merge the two images */
imagecopymerge($im1, $im2, $x, $y, 0, 0, $s2[0], $s2[1], $alpha);
/* Return the image */
imagejpeg($im1, '', 100);
imagedestroy($im1);
imagedestroy($im2);
?>
nur hab ihc keine ahnung was ich dann in den img tag schreiben soll..
kann mir jemand bitte helfen
mfg alex