Jump to content

PHP GD watermark help needed


acctman

Recommended Posts

1. use a transparent watermark.png (img that says domain name) if this can be done with a .ttf font that would be end better.

2. main.jpg get image size and then resize watermark.png by 25% if file main.jpg is less than 500x500 (will i lose transparancey if i resize?)

3. add transparent watermark.png to the center of main.jpg

4. save file as main_water.jpg

 

Link to comment
https://forums.phpfreaks.com/topic/152115-php-gd-watermark-help-needed/
Share on other sites

this is some example coding i've found so far

 


if ($perform_watermark == true) {

$watermark = imagecreatefrompng($watermark_image);
imagealphablending($watermark, false);
imagesavealpha($watermark, true);
$watermark_width = imagesx($watermark);
$watermark_height = imagesy($watermark);

// Position Overlay in Bottom Right
$dest_x = imagesx($newim) - $watermark_width;
$dest_y = imagesy($newim) - $watermark_height;

imagecopy($newim, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height);
imagedestroy($watermark);
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.