Ver Mensaje Individual
  #1 (permalink)  
Antiguo 12/12/2007, 13:00
Avatar de asinox
asinox
 
Fecha de Ingreso: enero-2002
Ubicación: Santo Domingo
Mensajes: 2.712
Antigüedad: 24 años, 8 meses
Puntos: 6
Ayuda con WaterMark

Hola, no se como aplicar un watermark a las fotos, no veo una forma....

funcion watermark:
Código PHP:
function watermarkImage ($SourceFile, $WaterMarkText, $DestinationFile) {
   list(
$width, $height) = getimagesize($SourceFile);
   
$image_p = imagecreatetruecolor($width, $height);
   
$image = imagecreatefromjpeg($SourceFile);
   
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width, $height);
   
$black = imagecolorallocate($image_p, 0, 0, 0);
   
$font = 'arial.ttf';
   
$font_size = 10;
   
imagettftext($image_p, $font_size, 0, 10, 20, $black, $font, $WaterMarkText);
   if (
$DestinationFile<>'') {
      
imagejpeg ($image_p, $DestinationFile, 100);
   } else {
      
header('Content-Type: image/jpeg');
      
imagejpeg($image_p, null, 100);
   };
   
imagedestroy($image);
   
imagedestroy($image_p);
}; 
uso de la funcion:
Código PHP:
$SourceFile = "photos/".$row[1];
$DestinationFile = 'asinoxWater.png';
$WaterMarkText = 'Copyright by Asinox';
watermarkImage ($SourceFile, $WaterMarkText, $DestinationFile); 

el problema donde esta?, pues que la galeria de fotos que estoy usando, es lightBox, manejada con javascript y para ver la foto "en grande" es via un link

ejemplo:
Código PHP:
<a href="photos/".$row[1]."\" class=\"highslide\" onclick=\"return hs.expand(this, {captionId: 'caption1'});\">
    <img src=\"photos/tb_"
.$row[1]."\" width=\"41\" height=\"41\">
</a> 
este es el thumb -> <img src=\"photos/tb_".$row[1]."\" width=\"41\" height=\"41\">

Entonces no veo, como pasarle la imagen a la funcion cuando haga click para ver la imagen en tamaño real (grande)

__________________
www.dataautos.com