|
|
Watermarks addon changes
Posted 03 April 2011 - 10:26 PM #1
Posted 08 April 2011 - 07:57 PM #2
mattls said:
Just do the following:
-Upload the .htacess file to your /images/detailed (or for that matter any dir that you want water marked.)
-Create a dir name wartermark
-add files : w.php & also your watermark image (which i called mark.png can be changed by editing the php file)
Thats it!
Dont know if this helps any one or not but sure makes it easier for me to just create the products & not have to do anything else.
I tried this but I am getting X mark for my detail images
What is EG user ?
is server need to setup something ?
Posted 09 April 2011 - 01:57 AM #3
netra4u said:
What is EG user ?
is server need to setup something ?
If your store is listed in a sub-dir you will need to edit the .htaccess file where it is :
RewriteRule .(gif|jpeg|jpg|png)$ /watermark/w.php [QSA,NC]
make sure and set it to : RewriteRule .(gif|jpeg|jpg|png)$ /YOUR STORE NAME/watermark/w.php [QSA,NC]
other wise you need to make sure your server is set to handle image creation, make sure you have GD Lib and ImageMagick installed.
This should handle any errors your getting. Please let me know otherwise and Ill take a look into it.
Posted 09 April 2011 - 04:38 AM #4
mattls said:
RewriteRule .(gif|jpeg|jpg|png)$ /watermark/w.php [QSA,NC]
make sure and set it to : RewriteRule .(gif|jpeg|jpg|png)$ /YOUR STORE NAME/watermark/w.php [QSA,NC]
other wise you need to make sure your server is set to handle image creation, make sure you have GD Lib and ImageMagick installed.
This should handle any errors your getting. Please let me know otherwise and Ill take a look into it.
It works now. Thank You
How can I make watermark position to center ?
Posted 09 April 2011 - 04:38 PM #5
netra4u said:
How can I make watermark position to center ?
Simple, in the php file edit like this:
--------------------
FIND THIS:
--------------------
$startwidth = (($imagewidth - $watermarkwidth) );
$startheight = (($imageheight - $watermarkheight) );
--------------------
REPLACE WITH:
--------------------
$startwidth = (($imagewidth - $watermarkwidth) /2);
$startheight = (($imageheight - $watermarkheight) /2);
replacing with that will center the watermark. You can mess with that number and it should change where the watermark is located. Fairly simple.
Posted 09 April 2011 - 06:17 PM #6
One is a Mod and one is an Addon. Two very different things.
Authorized Reseller - Cart licenses: $305 (lowest reseller price)
Custom B2B Development, Consulting and Special Projects (get a quote).
Commercial addons to meet your business and operations needs.
http://www.ez-ms.com
Posted 09 April 2011 - 09:48 PM #7
tbirnseth said:
One is a Mod and one is an Addon. Two very different things.
Agreed, my thoughts exactly! :confused:
Posted 15 April 2011 - 05:31 AM #8
mattls said:
RewriteRule .(gif|jpeg|jpg|png)$ /watermark/w.php [QSA,NC]
make sure and set it to : RewriteRule .(gif|jpeg|jpg|png)$ /YOUR STORE NAME/watermark/w.php [QSA,NC]
other wise you need to make sure your server is set to handle image creation, make sure you have GD Lib and ImageMagick installed.
This should handle any errors your getting. Please let me know otherwise and Ill take a look into it.
Hi,
I already try this method, but still not working.
I using rewrite to host multiple domains
RewriteEngine On
RewriteCond %{HTTP_HOST} shop.com
RewriteCond %{REQUEST_URI} !shop/
RewriteRule ^(.*)$ shop/$1 [L]
Even I set /watermark/w.php or /shop/watermark/w.php still doesn't work.
How can I solve it?
Thanks!
Posted 23 August 2011 - 10:08 AM #11
Posted 27 August 2011 - 10:09 PM #12
Let me go over a few things.. First this isn't dependent on cs-cart in any way and does not matter what version of cs-cart you are running. Even if its version 100.1 20 years from now. As long as the dir structure stays the same it will work fine.
Next, this in NO WAY SHAPE OR FORM will not make your images "pop up" like they used to. Once again like I said this doesnt edit any file on cs-carts side. If you dont delete the .htaccess file in the images/detailed/ dir then this will happen as the .htaccess file is trying to send the image to get watermarked.
This also will not change anything with your lightbox as stated above you forgot to delete the .htaccess file in the images dir.
Now I will reword and try to help you better understand how to install this mod.
I have revised the zip file for a little more direction on how to edit the files and made a dir structure to help on upload.
In the .htaccess file which is located in the dir /images/detailed/ it will look like this:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .(gif|jpeg|jpg|png)$ /watermark/w.php [QSA,NC]
If you have your store and all it's dir in a sub dir example: /store you will need to edit the .htaccess file as so:
RewriteRule .(gif|jpeg|jpg|png)$ /watermark/w.php [QSA,NC] <----- the bold needs to be edited to where you uploaded the watermark dir so if its /store then edit its to RewriteRule .(gif|jpeg|jpg|png)$ /store/watermark/w.php [QSA,NC]
Next is the watermark script its self, no editing should be needed unless you would like to change the location on the watermark or the name of your png watermark file. You will notice that your watermark image will need to be a png file!
The default name of this file is watermark.png and its located in the same folder as the w.php file!
That is it, it's very simple to use and install! Any questions feel free to message me before bashing me or the program for your user editing that is causing the problems! I dont mean to be harsh with what I say just when people are ungrateful for something given to them for free then start bashing them, it's uncalled for..
Lastly, if you need this mod and cant seem to figure out how to install it.. I can install it on your system for you given FTP access to your site. Unfortunately my labor is not free but for a small fee I can get this installed and working!
Please remember that this program requires GD Lib and ImageMagick installed
Attached Files
Posted 28 August 2011 - 01:59 AM #13
Cheers,
Scott.
Posted 28 August 2011 - 04:10 AM #14
I want to start by apologizing for my rude behavior. You are offering a FREE addon after all and I had no right to act that way, especially when you are trying to help people out.
So please forgive me for acting childish as I did, I was frustrated and acted out of ignorance.
Second. I finally got it working!
I think the issue was that I put the watermark dir in the detailed images dir, and not in the root dir.
The second issue was that on the first post you said you named your water mark image "mark.png"
So I did the same, not realizing that it should be "watermark.png".
Anyhow, it works great now!
Do you have a donate button anywhere?
Regards,
Bill
Posted 28 August 2011 - 02:47 PM #15
Posted 30 September 2011 - 08:36 AM #16
Posted 28 November 2011 - 05:41 PM #17
I have added some instructions to cache generated images.
Images with watermark will be stored in /wm/images/detailed/0/ directory.
So it will be only one generation of watermark.
After that every request will be forwarded to existing file.
<?php
// this script creates a watermarked image from an image file - can be a .jpg .gif or .png file
// where mark.png is a mostly transparent gif image with the watermark - goes in the same directory as this script
// where this script is named w.php
function sendfile($imagewm){
$fp = fopen($imagewm, 'rb');
// send the right headers
header("Content-Type: image");
header("Content-Length: " . filesize($imagewm));
// dump the picture and stop the script
fpassthru($fp);
fclose($fp);
return;
}
$imagesource = $_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI'];
$imagewm = $_SERVER['DOCUMENT_ROOT'].'/wm'.$_SERVER['REQUEST_URI'];
if ( file_exists($imagewm) ){
sendfile($imagewm);
return;
}else{
$filetype = substr($imagesource,strlen($imagesource)-4,4);
$filetype = strtolower($filetype);
if($filetype == ".gif") $image = @imagecreatefromgif($imagesource);
if($filetype == ".jpg") $image = @imagecreatefromjpeg($imagesource);
if($filetype == ".png") $image = @imagecreatefrompng($imagesource);
if (!$image) die();
$watermark = @imagecreatefrompng('lp.png');
$imagewidth = imagesx($image);
$imageheight = imagesy($image);
$watermarkwidth = imagesx($watermark);
$watermarkheight = imagesy($watermark);
$startwidth = 0;//(($imagewidth - $watermarkwidth) );
$startheight = (($imageheight - $watermarkheight) );
imagecopy($image, $watermark, $startwidth, $startheight, 0, 0, $watermarkwidth, $watermarkheight);
imagejpeg($image,$imagewm,90);
sendfile($imagewm);
imagedestroy($image);
imagedestroy($watermark);
}
?>
Posted 14 June 2012 - 08:27 AM #18
when i tick "watermark this image" and click save,nothing happens.it says yous changes have been saved but its unticked again.
does anyone have the same problem?




