News:

Looking for documentation? Take a look on our wiki

Main Menu

Virtuemart 3.0 watermark images

Started by dar3d3vil, August 12, 2015, 21:28:49 PM

Previous topic - Next topic

dar3d3vil

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

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

alexanderflr

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!
VM 3.2.8, Joomla 3.8.3, PHP 7.0.26

mauriziomomix

It seems that this method has become invalid with corrent PHP release.
Any advice about?