I have a problem with watermaking they have just sent an email those of the server saying to me that have suspended the service of hosting for using 77 % of resources of the CPU, and that or I arrange or me exit. I this am sure enough that it is for watermarking, I use this adjustment for gd image:
Hi everybody,
I made an modification to greg's great script cpg 1.1.
What does it?
It add's a .png watermark image to all your photo's and protects them from stealing
The script adds an image you specify to all your images. This will be done everytime, so the "original" image won't be harmed!!!
With htaccess you can protect your coppermine/albums/ directory: the server will have acces to the files, user(browsers) will need a password: (only if they try to steal the original images without the watermark, the images with the watermark are displayed in the CPG)
How to install?
step 1: find the file include/functions.inc.php,
go to the last lines, line 814 (824 in the nuke port) looks like:
Code:
return $url_prefix[$pic_row['url_prefix']]. path2url($pic_row['filepath']. $pic_prefix[$mode]. $pic_row['filename']);
change it to:
Code:
return 'logo.php?picturename='.$url_prefix[$pic_row['url_prefix']]. path2url($pic_row['filepath']. $pic_prefix[$mode]. $pic_row['filename']);
step 2: make a .png file which contains your logo (or just an png file with text), name it logo.png.
step 3: make a logo.php file with the folowing content:
Code:
<?
// SCHIPT BY DJ AXION
// e-mail: DJ@the-expansion.com
// Enjoy this script!
// GET SOURCE PICTURE FROM FORM INPUT
$b = imagecreatefromjpeg($picturename) or die ("Could not create from JPEG");
$bx = imagesx($b); // source width
$by = imagesy($b); // source height
$lm = $b;
if ($bx > 200) { // this ensures no watermark is added to small images (e.g. thumbnails)
// ADD WATERMARK
$pos = "bottomright"; //where is the watermark displayed...
if ($pos == "topleft") {
$src_x = 0;
$src_y = 0;
} else if ($pos == "topright") {
$src_x = $bx - 193;
$src_y = 0;
} else if ($pos == "bottomleft") {
$src_x = 0;
$src_y = $by - 187;
} else if ($pos == "bottomright") {
$src_x = $bx - 90;
$src_y = $by - 90;
}
// THIS IS THE CODE FOR THE WATERMARK
ImageAlphaBlending($lm, true) or die ("Could not alpha blend"); // Enable when on GD 2+
$logoImage = ImageCreateFromPNG('logo.png'); // logo.png is a watermark it add's...
$logoW = ImageSX($logoImage);
$logoH = ImageSY($logoImage);
ImageCopy($lm,$logoImage,$src_x,$src_y,0,0,$logoW,$logoH);
}
Imagejpeg($lm,'',80); //80 means JPEG quality
imageDestroy($lm);
?>
step 4 upload these 2 files to your cpg root directory, OR, to your website root directory when using the port.
That's it!
All the images will be save now! (except the thumbnails, because they are too small to add a watermark...)
Greetz,
DJ Axion
P.S. The logo.php file requires GD 2+
I need is that someone says to me the way of adapting it in order that it does not consume so too many resources of cpu since this script does the watermarking "on the air". I know an adjustment of another script in order that this excessive consumption was not taking produced of cpu but I don,t found, if can help me please.
Not Know exactly if the place is this where I have to write this post, if it is not like that forgive me the managers.
thanks in advance
best regards