Hi,
I have the watermark-addon installed, but I cannot find the instructions anymore.
Can anybody post them or direct me to the instructions?
Thank you!
/Holger
Watermark
Moderator: Experts
Hi David,
I got it on the opentools-site from the user "Morpheus".
In posting_attachments.php
After
I have
and
After
I have
That is not everything ... I am afraid.
/Holger
I got it on the opentools-site from the user "Morpheus".
In posting_attachments.php
After
Code: Select all
$this->post_attach = FALSE;
}
}
}
Code: Select all
//
// Function modificated by Morpheus to add support for other kind of images
//
//$filename should be a JPG and $watermark a PNG-24 with alpha transparency. $quality is 1-100 JPG quality on output.
function watermark($srcfilename, $newname, $watermark, $quality, $extension)
{
$imageInfo = getimagesize($srcfilename);
$width = $imageInfo[0];
$height = $imageInfo[1];
$logoinfo = getimagesize($watermark);
$logowidth = $logoinfo[0];
$logoheight = $logoinfo[1];
$horizextra = $width - $logowidth;
$vertextra = $height - $logoheight;
$horizmargin = round($horizextra);
$vertmargin = round($vertextra);
switch(trim(strtolower($extension)))
{
case "gif" :
$photoImage = ImageCreateFromGIF($srcfilename);
break;
case "jpeg" :
case "jpg" :
$photoImage = ImageCreateFromJPEG($srcfilename);
break;
case "png" :
$photoImage = ImageCreateFromPNG($srcfilename);
break;
case "bmp":
$photoImage = ImageCreateFromwBMP($srcfilename);
break;
}
ImageAlphaBlending($photoImage, true);
$logoImage = ImageCreateFromPNG($watermark);
$logoW = ImageSX($logoImage);
$logoH = ImageSY($logoImage);
ImageCopy($photoImage, $logoImage, $horizmargin, $vertmargin, 0, 0, $logoW, $logoH);
//ImageJPEG($photoImage); // output to browser
switch(trim(strtolower($extension)))
{
case "gif" :
ImageGIF($photoImage, $newname, $quality);
break;
case "jpeg" :
case "jpg" :
ImageJPEG($photoImage, $newname, $quality);
break;
case "png" :
ImagePNG($photoImage, $newname, $quality);
break;
case "bmp" :
ImagewBMP($photoImage, $newname, $quality);
break;
default :
break;
}
ImageDestroy($photoImage);
ImageDestroy($logoImage);
}
After
Code: Select all
global $error, $error_msg, $lang, $upload_dir;
Code: Select all
// if ( $attach_config['watermark_active'] )
// {
switch( $this->extension )
{
case "gif" :
case "jpg" :
case "jpeg" :
case "png" :
case "bmp" :
// $watermark = $attach_config['watermark_img'];
$watermark = "album_mod/mark.png";
// $quality = $attach_config['watermark_quality'];
$quality = "75";
$this->watermark($file, $file, $watermark, $quality, $this->extension);
break;
default :
break;
}
// }
/Holger
Try looking through this:
http://www.opentools.de/archive/index.php?t=2599
Looks like you'll have to put together some code and see what works...
http://www.opentools.de/archive/index.php?t=2599
Looks like you'll have to put together some code and see what works...