Hi,
It is possible to add watermark on images with ".htaccess" if they are stored in the database ?
I have a script and works fine with files stored in directory.
.htaccess
watermark.php
P.S. I read the forum that this feature will appear in version 4.1. Is this true? If yes, when version 4.1 will appear?
Best Regards,
It is possible to add watermark on images with ".htaccess" if they are stored in the database ?
I have a script and works fine with files stored in directory.
.htaccess
Code:
RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f RewriteRule .(gif|jpeg|jpg|png)$ /images/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 > 500) {
$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();
?>
P.S. I read the forum that this feature will appear in version 4.1. Is this true? If yes, when version 4.1 will appear?
Best Regards,
Comment