VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: dar3d3vil on August 12, 2015, 21:28:49 PM

Title: Virtuemart 3.0 watermark images
Post by: dar3d3vil on August 12, 2015, 21:28:49 PM
Hi!

I'm trying to watermark all my product images.

When using the method described here: http://forum.virtuemart.net/index.php?topic=130754.msg450634#msg450634 the product pictures still appear in list mode but when I click on the individual products, the product picture is converted to a text link. When I click on the text link for the picture i get this message:

"The requested content cannot be loaded.
Please try again later."

Obviously i am doing something wrong. Does this sound familiar?

I am using Joomla 3.0 and Virtuemart 3.0

Thanks
Title: Re: Virtuemart 3.0 watermark images
Post by: GJC Web Design on August 13, 2015, 16:25:13 PM
You must be doing something wrong -- I use this .htaccess method .. e.g.
http://www.ozepool.com/virtuemart/260/4/cartridge-filters/filter-system-1-2hp-pump-50sq-ft-cartridge-detail

in the images/virtuemart/products folder a .htaccess with

RewriteRule ^(resized)($|/) - [L]

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} -f

RewriteRule \.(gif|jpeg|jpg|png)$ watermark.php [QSA,NC]


in the same folder a file named watermark.php with

<?php

$path 
$_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI'];

$image imagecreatefromstring(file_get_contents($path));
$w imagesx($image);$h imagesy($image);


$watermark imagecreatefrompng('watermark.png');
$ww imagesx($watermark);
$wh imagesy($watermark);

imagecopy($image$watermark, (($w/2)-($ww/2)), (($h-40)-($wh/2)), 00$ww$wh);

header('Content-type: image/jpeg');
imagejpeg($image,null,95);
exit();
?>


and watermark.png
Title: Re: Virtuemart 3.0 watermark images
Post by: alexanderflr on August 02, 2017, 12:03:17 PM
Hi,

I tried the same solution and I have the same problem. The error message is "The requested content cannot be loaded.
Please try again later".

Joomla! 3.7.4 Stable, PHP 7.0.18, VirtueMart 3.2.2

If someone know other solution or a fix to this, I will appreciate if they can share with us. Thanks!
Title: Re: Virtuemart 3.0 watermark images
Post by: mauriziomomix on December 02, 2018, 00:30:59 AM
It seems that this method has become invalid with corrent PHP release.
Any advice about?