Estoy tratando de hacer un watermark. Tengo esta funcion:
Código PHP:
<?php
function watermarkImage ($SourceFile, $WaterMarkText, $WaterMarkText2, $DestinationFile) {
list($width, $height) = getimagesize($SourceFile);
$image_p = imagecreatetruecolor($width, $height);
$image = imagecreatefrompng($SourceFile);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width, $height);
$black = imagecolorallocate($image_p, 0, 0, 0);
$font = 'OctemberScript.ttf';
$font_size = 30;
imagettftext($image_p, $font_size, 30, 20, 250, $black, $font, $WaterMarkText);
imagettftext($image_p, $font_size, 30, 20, 300, $black, $font, $WaterMarkText2);
imagepng ($image_p, $DestinationFile, 9);
imagedestroy($image);
imagedestroy($image_p);
}
?>
Gracias de antemano
Salu2
Koz