Hi,
I have this script and works fine with images files.
I change files storage from database to directory "attach".
.htaccess
Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .(attach)$ /attach/1/watermark.php [QSA,NC]
watermark.php
PHP Code:
<?php
$path = $_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI'];
$image = imagecreatefromstring(file_get_contents($path));
$w = imagesx($image);
if ($w > 50) {
$h = imagesy($image);
$watermark = imagecreatefrompng('watermark.png');
$ww = imagesx($watermark);
$wh = imagesy($watermark);
imagecopy($image, $watermark, $w-$ww, $h-$wh, 0, 0, $ww, $wh);
}
header('Content-type: image/jpeg');
imagejpeg($image);
exit();
?>
I see watermark at this
address
But at this
address watermark not working. WHY ? it is the same file.
Please help me with that.
Best Regards,