VirtueMart Forum
VirtueMart 1.1.x [ Old version - no longer supported ] => Questions VM 1.1 ( the only active board for the old version) => Topic started by: Roderick1 on March 28, 2009, 15:31:18 pm
-
For all of you that want to watermark productimages with cache, here it is:
Download sript here:
http://www.dushiwebsites.nl/watermark-with-cache.zip (http://www.dushiwebsites.nl/watermark-with-cache.zip)
make a folder called "watermark" in your root and put in the files called:
- cache
- watermark.php
- watermark.png --> change this picture to your picture!
Then set the permissions 777 to the folder "cache".
The change the htaccess.txt to the folowing parameters:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule \.(gif|jpeg|jpg)$ ../../../../watermark/watermark.php [QSA,NC]
Now upload the htaccess.txt to components/com_virtuemart/shop_image/product/
and if you want to the thumbnails in components/com_virtuemart/shop_image/product/resized.
AND RENAME TO .htaccess
And you are done 8)
Check my site as demo:
http://www.thulefietsdragershop.nl/index.php/Thule/Thule-EuroPower-916/flypage.tpl.html (http://www.thulefietsdragershop.nl/index.php/Thule/Thule-EuroPower-916/flypage.tpl.html)
Works on joomla 1.5.10 and virtuemart 1.1.3.
-
that's great
thanks a lot man
-
Did it work for you ok?
-
I just said thank you for sharing but not yet installed!
It dosn't work?
-
O no its works great, just was asking if your install went fine :)
-
It works like a charm
Thank youuuuuuuuuuuuuu
NB: permission for cache file 755 works perfect
Thanks
-
Is it possible to change the watermark image position?:)
Now it's showen on the bottom right
-
i know it is but dont know how... sorry
-
Well now is it possible to make 2 watermark images? One big for the image and one little for the thumb
Because the resized images dosn't read the big (relative) watermark.
Best regards
and thank you
-
with me both the images get watermarkt
-
I got it working !
Right now my absolute path is in the .htaccess specified as /home/user/www/joomla/watermark/watermark.php (www is root)
Is there a way to make the path to be NOT absolute so when I end up moving the test site to live hosting space it will not get broken?
i assume on the live hosting space it will be /watermark/watermark.php
Thanx u4davidatgmaildotcom
-
Hello
On the live site you should write :
../../../../watermark/watermark.php
Best regards
Amorino
-
Oeps... forgot to mension that :)
-
i can not get this to work...
i uploaded the files, changed permission and renamed htaccess.txt to .htaccess but no watermark shows up..
help :-[ :-[ :-[ :-[ :-[ :-[ :-[ :-[!!
-
did you do this:
On the live site you should write :
../../../../watermark/watermark.php
-
Hey Rod,
Found your thread and am interested in this to. Looked at your site, are you not using it anymore?
I'm working local on windows with xampp, I need to know how to config the .htaccess file cause images are not loading anymore.
regards Jerry
NL
-
Hello Jerry,
(Schrijf dit in engels zodat iedereen het kan lezen)
I have no experience with local servers and this script and would not know if this would work or not..
Is there a way you can test it on a live website?
My client did not want to use it anymore so i took it off.
But it should work out of the box without any problems.
-
OKey then,
Whel I was hacked early januari and going back live soon.
It is only not easy when I'm developping and pics don't load because of the watermark. But it not the worst. I'll come back to you when I'm live.
I do think I will need a little help :-[
regards Jerry
-
Jerry look me up on the internet and find my email adress " Dushiwebsites "
-
Amorino, if you want to change the position of watermark,
in watermark.php on line 32 change:
imagecopy($image, $watermark, $w-$ww, $h-$wh, 0, 0, $ww, $wh);
to one of the following lines, where you want the watermark appear
// (top left)
imagecopy($image, $watermark, 0, 0, 0, 0, $ww, $wh);
// (top center)
imagecopy($image, $watermark, (($w/2)-($ww/2)), 0, 0, 0, $ww, $wh);
// (top right)
imagecopy($image, $watermark, $w-$ww, 0, 0, 0, $ww, $wh);
// (left centre)
imagecopy($image, $watermark, 0, (($h/2)-($wh/2)), 0, 0, $ww, $wh);
// (centre)
imagecopy($image, $watermark, (($w/2)-($ww/2)), (($h/2)-($wh/2)), 0, 0, $ww, $wh);
// (right centre)
imagecopy($image, $watermark, $w-$ww, (($h/2)-($wh/2)), 0, 0, $ww, $wh);
// (bottom left)
imagecopy($image, $watermark, 0, $h-$wh, 0, 0, $ww, $wh);
// (bottom center)
imagecopy($image, $watermark, (($w/2)-($ww/2)), (($h)-($wh)), 0, 0, $ww, $wh);
// (bottom right)
imagecopy($image, $watermark, $w-$ww, $h-$wh, 0, 0, $ww, $wh);
The watermark script works well on my localhost, but I am not able to configure it to run properly on live site. Using "../../../../watermark/watermark.php" I get an error, that the file was not found.
-
You need to check if the file is there or not, and check that the path is the same as on your localhost server.
-
Roderick1, yes, the file si there, but it is not shown. When I rename htaccess, the file is shown.
-
Did you do this:
Now upload the htaccess.txt to components/com_virtuemart/shop_image/product/
and if you want to the thumbnails in components/com_virtuemart/shop_image/product/resized.
AND RENAME TO .htaccess
Explain what you are doing to me..
-
For all of you that want to watermark productimages with cache, here it is:
Hello, I try to use watermark with joomla 1.5.15 and Virtuemart 1.1.4 and it doesn't work. No watermark is created. My install is local php5-gd and PCRE are installed. Somebody have the same problem ? Thank's a lot for your help.
Frédéric
-
please triple check your path to the folder ../../../../
-
please triple check your path to the folder ../../../../
Hello,
Problem is apache config (mod_rewrite) with ubuntu linux...
Thank's for your help
Frédéric
-
So it has been fixed and is working now?
-
So it has been fixed and is working now?
No, because it's not a priority for the moment =:o)
Thank's for your messages
-
At first it looked very good. But now I'm having errors when I add multiple images. When I'm looking in the mediamanager and trying to look at a file, I'm getting the next error.
Warning: file_get_contents(/var/www/vhosts/mydomain.nl/httpdocs/joomla/components/com_virtuemart/shop_image/product/21004%20%20[website].jpg4ba776fde8b73.jpg) [function.file-get-contents]: failed to open stream: No such file or directory in /var/www/vhosts/mydomain.nl/httpdocs/joomla/watermark/watermark.php on line 24
Warning: imagecreatefromstring() [function.imagecreatefromstring]: Empty string or invalid image in /var/www/vhosts/mydomain.nl/httpdocs/joomla/watermark/watermark.php on line 24
Warning: imagesx(): supplied argument is not a valid Image resource in /var/www/vhosts/mydomain.nl/httpdocs/joomla/watermark/watermark.php on line 26
Warning: imagesy(): supplied argument is not a valid Image resource in /var/www/vhosts/mydomain.nl/httpdocs/joomla/watermark/watermark.php on line 27
Warning: imagecopy(): supplied argument is not a valid Image resource in /var/www/vhosts/mydomain.nl/httpdocs/joomla/watermark/watermark.php on line 35
Warning: imagejpeg(): supplied argument is not a valid Image resource in /var/www/vhosts/mydomain.nl/httpdocs/joomla/watermark/watermark.php on line 44
Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/mydomain.nl/httpdocs/joomla/watermark/watermark.php:24) in /var/www/vhosts/mydomain.nl/httpdocs/joomla/watermark/watermark.php on line 56
Warning: readfile(cache/efbef59cc9513d7ddd4800b218888967) [function.readfile]: failed to open stream: No such file or directory in /var/www/vhosts/mydomain.nl/httpdocs/joomla/watermark/watermark.php on line 67
In the front end there's only a placeholder visible.
Can anyone tell me what's going wrong?
-
Hi Roderick1,
The link http://baglan.web.tr/media/watermark-with-cache/watermark-with-cache.zip not available.
Please correct this.
Thanks
xms
-
I am also looking for an updated link, want to use this for my store
-
didn't work for me, i use joomla 1.5.18, VM 1.1.4, and sh404sef, when i activated it, full product images didn't show up. After I delete it, it comes to normal. http://foto.maubikinweb.com, any solution for this? thanks
-
Hi Roderick1,
The link http://baglan.web.tr/media/watermark-with-cache/watermark-with-cache.zip not available.
Please introduce me with How to setting that.
Thanks for kindly.
-
The link has been updated :)
-
thanks! this comes in handy! :)
well, but the shop pictures now suffer bad quality. maybe because of the recompressing by GD Lib?
hmm, how to improve that?
-
Do you have a link for me DansKO?
-
Hi: We are now using this watermarking tool for our VirtueMart install. I am wondering if anyone found a fix so that the tool would ONLY watermark the full image and NOT the thumbnail images? If so, please post what we need to do in this thread!!
-
it didnt worked for me when i tested it local.
-
dont test it local but live
-
dont test it local but live
this doesnt get in complex with the main htaccess thats in root direcotry right?
-
nope :)
-
i did that and it worked with some issues that i am trying to figure out.
in the flypage my thumbnail is 130x130 but the watermark doesnt resize. there must be a thumb of the watermark as well?/
-
If there is a way to correctly watermark the thumbnail (with a "mini" version of the mark in the lower right corner, just like the mark on the full sized image), I would be very interested in learning how. Ron
-
Hi, simple... make two versions of this script and two sets of css :)
-
Hi: We are now using this watermarking tool for our VirtueMart install. I am wondering if anyone found a fix so that the tool would ONLY watermark the full image and NOT the thumbnail images? If so, please post what we need to do in this thread!!
Up!!!
-
hat do you mean by UP? ???
-
Does this work for Virtuemart 1.1.7 and joomla 1.5.22?
-
Does this work for Virtuemart 1.1.7 and joomla 1.5.22?
Everything works perfectly for me on this configuration.
-
Hi,
Thanks for this, I was looking all over for it.
However, is there any way to apply this functional to the rest of the pictures in the product description? In my site I use also pictures in the product description, in case I have a product zoom, or additional photos.
Thanks :D
Edit: I tried to put the .htaccess file inside the folder that contains the images, however it does not show the pictures any more, so I had to delete the file to fix it.
The path to the images is: images/stories/products/fotl/ which is the same depth as components/com_virtuemart/shop_image/product/ and so RewriteRule \.(gif|jpeg|jpg)$ ../../../../watermark/watermark.php should be working, but it doesn't. I'm so puzzled. Please help.
-
I have attempted to add this to virtuemart version 1.1.8
...however the product images are now being completely removed in the front end.
In order to get this to work in the newer version what modifications would I need to make?
Thanks in advance
-
Any idea why I'm getting a 500 Server Error?
500 Server Error A misconfiguration on the server caused a hiccup. Check the server logs, fix the problem, then try again.
[Thu Jun 09 08:57:46 2011] [error] [client 61.247.204.36] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
It looks like watermark.php is passing also throw the products\.htaccess to get the path of the image, creating a hiccup.
I'm using this watermark in the same server (another joomla site, same versions) without any problem :(
Any idea?
-
Hi there,
unfortunately this is nor working on my website vinyldesign.com.au (http://vinyldesign.com.au)...
my virtuemart template uses phatfusion slideshow, and I guess this is the reason why no images are shown when I put te .htaccess file in the required folder.
Anyone else having the same problem? Possible solutions?
-
Hi: We are now using this watermarking tool for our VirtueMart install. I am wondering if anyone found a fix so that the tool would ONLY watermark the full image and NOT the thumbnail images? If so, please post what we need to do in this thread!!
I would be very greatfull for that kind of fix, because I would like to do exactly the same.
-
You have to disable the .htaccess in the thumbnails folder.
(components/com_virtuemart/shop_image/product/resized)
-
Hi,
thanks for your answer. I disabled the watermark for thumbnails, but the main thumbnail image on product page still has watermark. Is possible to disable this one to?
Here is the product page: http://www.fetis.si/sl/cevlji-in-skornji/sandali/detail/59/flypage/174.html?sef=hcfp
-
What do you mean when you say "Up". Can you please have this elaborated?
-
I manages to make it work in the fly page, but it doesn't work in the browse pages. Anyone knows how to fix this?
-
I did everything you said. But my virtuemart-site is a subdomain, and domain is another site on joomla. This really works on my localhost. But not on a real site. Can you tell me what should I do to fix this and to see watermark on my virtuemart products?
tanks
-
I used the water mark with high success on local server.
I head to specify the absolute path instead of the ../../../../.
On live server @ godaddy linux hosting (that id do not recommend ).
I can not make it work.
My cache is empty and 777
tried the original ../../../../ and I get redirected back to the homepage that goes fro any other path in that tree that I tried.The link on the home page points to the image but the home page is what is loaded on the pop up window.
Only when I leave /watermark/watermark.php I get error message.
I think there is problem with link rewriting in environments on the server.Some servers have redirect,schroots......
Any clue how to properly detect what is happening when this redirect rewrite runs?
-
I have same problem too, I use vm 1.1.19 an Joomla 1.5.25 .
how we can fix this line:
../../../../watermark/watermark.php
or others?
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule \.(gif|jpeg|jpg)$ ../../../../watermark/watermark.php [QSA,NC]
-
I am trying to install this on a site using Joomla 1.5.25 and Virtuemart 1.1.9. I created my Watermarks folder in my joomla directory and uploaded the files there. I created the .htaccess file as follows:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule \.(gif|jpeg|jpg)$ ../../../../watermark/watermark.php [QSA,NC]
When I upload new pictures nothing happens. What am I doing wrong?
-
this is great, and works on local...
when I upload, I will know is it working, but for now, it is ok...
something more interesting...
is there any chance to make watermark repeat, in some angle, etc 30o
you know... repeating watermark to whole product image...
-
don't work on images on browse page...?
-
Hi,
Thanks for the script. It works really well. However, if my images have spaces in it, somehow the image is not loaded at all.
Anyone encountered this issue? Please help.
-
Fixed the problem. Reason was because when it stream, it was replacing spaces with %20. Added the "$path_new" parameter.
$generated = CACHE.md5($_SERVER['REQUEST_URI']);
$path_new = str_replace("%20"," ",$path);
if (file_exists($generated))
$generated_at = filectime($generated);
// Generate image?
if (
!file_exists($generated) /* if generated file doesn't exist */
|| $generated_at<=filectime($path_new ) /* or generated file is older than the original */
|| $generated_at<=filectime(WATERMARK) /* or generated file is older than watermark file */
|| $generated_at<=filectime(__FILE__) /* or generated file is older than this script file */
) {
// Load image
$image = imagecreatefromstring(file_get_contents($path_new));
-
Hi,
I am using virtuemart 1.1.9 and if I place the .htaccess in the folder, but like others then my pictuers don,t show,
maybe the answer to that is already in this discussion but I cant,t seem to get it work.
can anybody help. Thanks
-
Same here guys,
product image is not shown at all. A broken image is shown instead.
Joomla 2.5.7, VM 2.0.10
-
I do have the same problem, the broken images appear when .htaccess is in the folder...
-
This works like clock work! ! ! ! ! ! ! ! ! ! ! ! !
What a smart solution!!!!
tried on Joomla 1.5.26 + VirtueMart 1.1.9 . caching and all works superbly!
Thanks a lot for sharing!!!
:-* :-* :-*
-
Hi,
It worked for me on my local test PC, but on the hosting, they enforce
RewriteBase / which seems to complicate things a bit.
.htaccess placed in .../product/ folder does not do the job,
and whatever I try as far as changes to Rewrite rules
does not seem to help..
Some of the latest version is:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^images/stories/virtuemart/product/(.*)\.(jpeg|jpg)$ /watermark/watermark.php [QSA,NC]
I also tried to put the same in the root .htaccess
Somehow I suspect that the issue might be with relating the URI to watermark.php, i.e. maybe something needs to be changed here:
$path = $_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI'];
preg_match('@\.(gif|jpg|jpeg|png)$@i',$_SERVER['REQUEST_URI'],$m);
$ext = strtolower($m[1]);
$generated = CACHE.md5($_SERVER['REQUEST_URI']);
or Rules should store some more parameters, like in:
RewriteCond %{REQUEST_URI} ...
But I'm complete noob in php, so would hope someone could help me.
I'm using it in Joomla 2.5.6 / VM 2.0.10
-
Solved my problem. It appears that the paths are returned differently on Linux vs my PC XAMPP.
So, eventually, I have htaccess in images folder, stating something like:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^(.*)\.(jpg)$ /watermark/watermark.php [QSA,NC]
And then a bit modified code in watermark.php, which is in the /watermark/ in the root.
$path = '../'.$_SERVER['REQUEST_URI'];
-
Glad to you guys are still using this script, even in joomla 2.5 ;D
-
Hello...
With the included .htaccess file i always get 400 error when i try to load any picture.
If i remove the htaccess the pictures is loading fine but of course without watermark.
Can someone help me with that ?
Thank you.
-
Anyone ?
-
Nope... i really do not know why it would give you a 400 error, contact your hosting guys and ask them if they know why..
-
I already contact them.
They cant provide me with coding help.
They just tell me that i need to change the command in .htaccess file because the Apache can't handle the request.
This is the error they get:
It seems this code renderes the following apache error:
###
[Tue Oct 23 11:41:20 2012] [error] [client xxx.xxx.xxx.xxx] Invalid URI in request GET /estore/components/com_virtuemart/shop_image/product/100000/100203.jpg HTTP/1.0
###
Can you please please help me ?
-
It maybe sounds crazy, but change hosting, if their apache cant handle this you are bound to get more problems in the future
-
I can't change hosting right now...
I have payed for one year in advance just 2 months ago :(
We can't do anything for the problem ?
-
Maybe somebody else can here but i dont see it, sorry
-
:(
There is no other way to "get" the picture from the .htaccess ?
They give me 2 links as a reference, but i am not so familiar with apache commands.
Maybe you can find something there ?
http://stackoverflow.com/questions/12800733/modifying-rewrite-rules-in-subfolder-when-rewritebase-is-enforced
http://stackoverflow.com/questions/9044054/htaccess-and-watermark
-
Any help please ?
-
Please please please !!!
-
Works well as a category where the images are without watermark.
I think it does not work because there are pictures link -> http://www.domain.com/components/com_virtuemart/show_image_in_imgtag.php?filename=resized%2F__pir__la_1_6_mm_50c10e2fd1628_300x300.jpg&newxsize=300&newysize=300&fileout=
What should I do to be a watermark on the images displayed in the category?
-
Hi,
compliment to the script, very useful.
The watermak can be clearly seen on the product page, ie in the flypage, but if I wanted to see it even in the browse page? What to do?
Thank you.
-
Hi to all,
Im the original poster of this script.
Im going to update this script with more options, and its going to become an official plugin to be used in joomla 1.5 - 2.5 - 3.0 and also for new version of virtuemart.
We will be up and running with this in two weeks. details will follow on our new website at http://www.top-motion.be
So be patient just a while longer :)
regards,
Roderick.
-
Hello,
I have Joomla 2.5 and VM2.0.20
It works well with JPG and GIF files, but it wont display the watermark on PNG's.
Does someone also have this problem...?
cheers,
Flex
-
Dont worry, im building the new version as we speak, and it will have a lot of options :)
Hello,
I have Joomla 2.5 and VM2.0.20
It works well with JPG and GIF files, but it wont display the watermark on PNG's.
Does someone also have this problem...?
cheers,
Flex
-
Dont worry, im building the new version as we speak, and it will have a lot of options :)
And how is going? Some news?
-
Dont worry, im building the new version as we speak, and it will have a lot of options :)
And how is going? Some news?
My programmer quit on me :( but i will get back on this soon
-
Really need watermark on related products (=browse) too.
Hope that you will have enough time to do that ;)
-
Hello,
I am using Joomla 2.5 nad VM 2.0.26d latest version.
I have found similar tutorial how add watermark here
http://mtkcode.blogspot.com/2013/07/apply-watermark-image-into-product.html
but I am facing similar issues like many users described above. My pictures do not show on VM (like it would be broken link). I have try to add permissions to chache folder to 777 but that didn't change anything.
Any suggestions?
Thank you!
Adi