Leider scheint es bei mir nicht zu funktionieren. Folgende Fehler treten auf:
Warning: file_get_contents(/home/strato/www/ta/www.site.de/htdocs/components/com_virtuemart/shop_image/product/bild.jpg) [function.file-get-contents]: failed to open stream: No such file or directory in /mnt/web4/33/01/76943518/htdocs/site/components/com_virtuemart/shop_image/product/watermark.php on line 8
Warning: imagecreatefromstring() [function.imagecreatefromstring]: Empty string or invalid image in /mnt/web4/33/01/76943518/htdocs/site/components/com_virtuemart/shop_image/product/watermark.php on line 8
Warning: imagesx(): supplied argument is not a valid Image resource in /mnt/web4/33/01/76943518/htdocs/site/components/com_virtuemart/shop_image/product/watermark.php on line 9
Warning: imagesy(): supplied argument is not a valid Image resource in /mnt/web4/33/01/76943518/htdocs/site/components/com_virtuemart/shop_image/product/watermark.php on line 10
Warning: imagecopy(): supplied argument is not a valid Image resource in /mnt/web4/33/01/76943518/htdocs/site/components/com_virtuemart/shop_image/product/watermark.php on line 18
Warning: Cannot modify header information - headers already sent by (output started at /mnt/web4/33/01/76943518/htdocs/site/components/com_virtuemart/shop_image/product/watermark.php:8) in /mnt/web4/33/01/76943518/htdocs/site/components/com_virtuemart/shop_image/product/watermark.php on line 21
Warning: imagejpeg(): supplied argument is not a valid Image resource in /mnt/web4/33/01/76943518/htdocs/site/components/com_virtuemart/shop_image/product/watermark.php on line 22
Vielleicht ligt es an PHP5?
hier ist watermark.php
- Code: Select all
<?php
// watermark.php
// Path the the requested file
$path = $_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI'];
// Load the requested image
$image = imagecreatefromstring(file_get_contents($path));
$w = imagesx($image);
$h = imagesy($image);
// Load the watermark image
$watermark = imagecreatefrompng('watermark.png');
$ww = imagesx($watermark);
$wh = imagesy($watermark);
// Merge watermark upon the original image
imagecopy($image, $watermark, $w-$ww, $h-$wh, 0, 0, $ww, $wh);
// Send the image
header('Content-type: image/jpeg');
imagejpeg($image,null,95);
exit();
?>
und .htaccess
- Code: Select all
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule \.(gif|jpeg|jpg|png)$ watermark.php [QSA,NC]
Weiß jemand was an dem Sode falsch sein könnte?
Danke im Voraus.
LG Alex.