Foros del Web » Programando para Internet » PHP »

Error en imagenes dinamicas

Estas en el tema de Error en imagenes dinamicas en el foro de PHP en Foros del Web. Hola amigos, queria cometarles que he creado un formulario en el cual se coloca unos datos, al terminar eso.Los datos son colocados en una imagen. ...
  #1 (permalink)  
Antiguo 20/06/2011, 18:07
 
Fecha de Ingreso: junio-2011
Mensajes: 1
Antigüedad: 12 años, 10 meses
Puntos: 0
Error en imagenes dinamicas

Hola amigos, queria cometarles que he creado un formulario en el cual se coloca unos datos, al terminar eso.Los datos son colocados en una imagen.
El tema es que no me carga la pagina donde deberia aparecer los datos.
Aqui dejos los archivos:

Imagen:PHP

Cita:
<?php
$ancho=100;
$alto=30;
$imagen=imageCreatefrompng("post.PNG");
$amarillo=ImageColorAllocate($imagen,255,255,0);
$titulo = $_POST['titulo'];
$año = $_POST['año'];
$pais = $_POST['pais'];
$genero = $_POST['genero'];
$portada = $_POST['portada'];
$produccion = $_POST['produccion'];
$reparto = $_POST['reparto'];
$director = $_POST['director'];
$sinopsis = $_POST['sinopsis'];
$formato = $_POST['formato'];
$calidad = $_POST['calidad'];
$idioma = $_POST['idioma'];
$peso = $_POST['peso'];

$fuente = 'verdana.ttf';

$portadafinal = imagecreatefromjpeg($portada);

$x = ImagesX($portadafinal);//para el ancho
$y = ImagesY($portadafinal);//para el alto

imagecopyresized ($imagen , $portadafinal, 20, 17, 0, 0, 138, 173, $x, $y);

imagettftext($imagen, 15, 0, 234, 42, $amarillo, $fuente, $titulo);
imagettftext($imagen, 15, 0, 234, 42, $amarillo, $fuente, $año);
imagettftext($imagen, 15, 0, 234, 42, $amarillo, $fuente, $pais);
imagettftext($imagen, 15, 0, 234, 42, $amarillo, $fuente, $genero);
imagettftext($imagen, 15, 0, 234, 42, $amarillo, $fuente, $produccion);
imagettftext($imagen, 15, 0, 234, 42, $amarillo, $fuente, $reparto);
imagettftext($imagen, 15, 0, 234, 42, $amarillo, $fuente, $director);
imagettftext($imagen, 15, 0, 234, 42, $amarillo, $fuente, $sinopsis);
imagettftext($imagen, 15, 0, 234, 42, $amarillo, $fuente, $formato);
imagettftext($imagen, 15, 0, 234, 42, $amarillo, $fuente, $calidad);
imagettftext($imagen, 15, 0, 234, 42, $amarillo, $fuente, $idioma);
imagettftext($imagen, 15, 0, 220, 70, $amarillo, $fuente, $peso);

Header ("Content-type: image/png");
ImageJPEG ($imagen);
ImageDestroy($imagen);
?>
Formu: HTML

Cita:
<!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=utf-8" />
<title>Formulario</title>
</head>
<form method="post" action="imagen.php">
Titulo del post:
<br>
<input type="text" name="titulo">
<br>
Año
<br>
<input type="text" name="año">
<br>
Pais:
<br>
<input type="text" name="pais">
<br>
Genero
<br>
<input type="text" name="genero">
<br>
Imagen portada del post:
<br>
<input type="text" name="portada">
<br>
Produccion
<br>
<input type="text" name="produccion">
<br>
Reparto
<br>
<input type="text" name="reparto">
<br>
Director
<br>
<input type="text" name="director">
<br>
Sinopsis
<br>
<input type="text" name="sinopsis">
<br>
Formato:
<br>
<input type="text" name="formato">
<br>
Calidad:
<br>
<input type="text" name="calidad">
<br>
Idioma
<br>
<input type="text" name="idioma">
<br>
<input type="submit" value="Generar post!">
</form>
<body>
</body>
</html>
Espero que me puedan ayudar.
saludos!
  #2 (permalink)  
Antiguo 27/06/2011, 14:40
Avatar de repara2  
Fecha de Ingreso: septiembre-2010
Ubicación: München
Mensajes: 2.445
Antigüedad: 13 años, 7 meses
Puntos: 331
Respuesta: Error en imagenes dinamicas

La imagen se muestra pero el formato parece incorrecto. Checklist:
1. Comprueba que el png existe
2. No utilices "enie" (lo siento pero tengo teclado alemán) en los índices de $_POST
3. Comrueba el nombre y la ruta de la fuente utilizada
4. COmprueba los siguientes mensajes:


Notice: Undefined index: peso in /var/www/test/imagen.php on line 20

Warning: imagecreatefromjpeg(e) [function.imagecreatefromjpeg]: failed to open stream: No such file or directory in /imagen.php on line 24

Warning: imagesx() expects parameter 1 to be resource, boolean given in /var/www/test/imagen.php on line 26

Warning: imagesy() expects parameter 1 to be resource, boolean given in /var/www/test/imagen.php on line 27

Warning: imagecopyresized() expects parameter 2 to be resource, boolean given in /var/www/test/imagen.php on line 29

Warning: imagettftext() [function.imagettftext]: Could not find/open font in /var/www/test/imagen.php on line 31

Warning: imagettftext() [function.imagettftext]: Could not find/open font in /var/www/test/imagen.php on line 32

Warning: imagettftext() [function.imagettftext]: Could not find/open font in /var/www/test/imagen.php on line 33

Warning: imagettftext() [function.imagettftext]: Could not find/open font in /var/www/test/imagen.php on line 34

Warning: imagettftext() [function.imagettftext]: Could not find/open font in /var/www/test/imagen.php on line 35

Warning: imagettftext() [function.imagettftext]: Could not find/open font in /var/www/test/imagen.php on line 36

Warning: imagettftext() [function.imagettftext]: Could not find/open font in /var/www/test/imagen.php on line 37

Warning: imagettftext() [function.imagettftext]: Could not find/open font in /var/www/test/imagen.php on line 38

Warning: imagettftext() [function.imagettftext]: Could not find/open font in /var/www/test/imagen.php on line 3

Warning: imagettftext() [function.imagettftext]: Could not find/open font in /var/www/test/imagen.php on line 41

Warning: imagettftext() [function.imagettftext]: Could not find/open font in /var/www/test/imagen.php on line 41

Warning: imagettftext() [function.imagettftext]: Could not find/open font in /var/www/test/imagen.php on line 42

Salu2!!
__________________
Fere libenter homines, id quod volunt, credunt.
  #3 (permalink)  
Antiguo 28/06/2011, 07:50
Avatar de mayid
Colaborador
 
Fecha de Ingreso: marzo-2009
Ubicación: BsAs
Mensajes: 4.014
Antigüedad: 15 años, 1 mes
Puntos: 101
Respuesta: Error en imagenes dinamicas

Ojo que no estas validando ningun campo. Y si alguno llegara vacío, puede que se te arruine todo el script...

Etiquetas: dinamicas, imagenes
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 20:05.