Ver Mensaje Individual
  #7 (permalink)  
Antiguo 10/11/2010, 20:03
nngg
 
Fecha de Ingreso: marzo-2005
Mensajes: 201
Antigüedad: 19 años
Puntos: 0
Respuesta: Script para tratamiento de imagen problematico

Listo. Gracias, igualmente por tu tiempo y atención, Sourcegeek.

Cluster, a lo largo de los siglos, en su legado infinito, me ha dado la solución:

Archivo 1:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin título</title>
</head>
<body>
<img src="imagenes/ABCpdre025634.jpg" width="400" height="266" /> <img src="PRUEBA_MARCA_AGUA_2.php">
</body>
</html>


Segundo archivo:
PRUEBA_MARCA_AGUA_2.php

<?php
function watermark($origen,$marca){
$estampa = imagecreatefrompng($marca);
$im = imagecreatefromjpeg($origen);
$tam_1=getimagesize($origen);
$tam_2=getimagesize($marca);
$pos_1=($tam_1[0]-$tam_2[0])/2;
$pos_2=($tam_1[1]-$tam_2[1])/2;
$márgen_dcho = $pos_1;
$márgen_inf = $pos_2;
header('Content-type: image/png');
$sx = imagesx($estampa);
$sy = imagesy($estampa);
imagecopy($im, $estampa, imagesx($im) - $sx - $márgen_dcho, imagesy($im) - $sy - $márgen_inf, 0, 0, imagesx($estampa), imagesy($estampa));
imagepng($im);
imagedestroy($im);}
watermark("imagenes/ABCpdre025634.jpg","imagenes/ALOVIU.png");
?>