watermark with margin watermark with margin
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

watermark with margin

Started by Linosa, August 27, 2008, 11:30:05 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Linosa

I wanna place my watermark image bottom left, but it displayes with some pixles margin. Why is that and how do I change it?

Stramm

Quote from: Linosa on August 27, 2008, 11:30:05 PM
Why is that
Cause it's coded that way.

Quote from: Linosa on August 27, 2008, 11:30:05 PM
and how do I change it
You need to change the code responsible for that (picmgmnt.inc.php). The 'margin' is 5 px... so just search for 5 in function resize_image()
if you use gd2, then few lines below
        case "gd2" :

    $pos = $CONFIG['where_put_watermark'];
if ($pos == "northwest") {
$src_x = 5;
$src_y = 5;
} else if ($pos == "northeast") {
$src_x = $destWidth - ($logoW + 5);
$src_y = 5;
} else if ($pos == "southwest") {
$src_x = 5;
$src_y = $destHeight - ($logoH + 5);
} else if ($pos == "southeast") {
$src_x = $destWidth - ($logoW + 5);
$src_y = $destHeight - ($logoH + 5);
} else if ($pos == "center") {
$src_x = ($destWidth/2) - ($logoW/2);
$src_y = ($destHeight/2) - ($logoH/2);
}

Linosa