Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/06/2011, 12:07
kuervito
 
Fecha de Ingreso: enero-2011
Mensajes: 39
Antigüedad: 13 años, 3 meses
Puntos: 1
Problema con imagenes dinamicas

Estoy armando un generador de Plantillas para peliculas, para armar megapost.
Y estoy teniendo este error:
Cita:
Warning: imagecopyresized(): supplied argument is not a valid Image resource in /home4/stune/public_html/web/cue/gen/imagen.php on line 18 Warning: Cannot modify header information - headers already sent by (output started at /home4/stune/public_html/web/cue/gen/imagen.php:18) in /home4/stune/public_html/web/cue/gen/imagen.php on line 25
Abajo de line 25 una lista de codigos inentendibles :P

Estos son los codigos que tengo:

Formu.html

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>Formulario</title>
  5. </head>
  6. <form method="post" action="imagen.php">
  7.   Titulo del post:
  8.   <br>
  9.   <input type="text" name="titulo">
  10.   <br>
  11.   Genero:
  12.   <br>
  13.   <input type="text" name="genero">
  14.   <br>
  15.   Imagen portada del post:
  16.   <br>
  17.   <input type="text" name="portada">
  18.   <br>
  19.   Peso:
  20.   <br>
  21.   <input type="text" name="peso">
  22.   <br>
  23.   Servidor:
  24.   <br>
  25.   <input type="text" name="servidor">
  26.   <br>
  27.   <input type="submit" value="Generar post!">
  28.   </form>
  29. </body>
  30. </html>

Imagen.php
Código PHP:
Ver original
  1. <?php
  2. $ancho=100;
  3. $alto=30;
  4. $imagen=imageCreatefrompng("post.PNG");
  5. $amarillo=ImageColorAllocate($imagen,255,255,0);
  6. $titulo = $_POST['titulo'];
  7. $portada = $_POST['portada'];
  8. $peso = $_POST['peso'];
  9. $servidor = $_POST['servidor'];
  10. $genero = $_POST['genero'];
  11. $portada = $_POST['portada'];
  12. $fuente = 'verdana.ttf';
  13.  
  14.  
  15. list($width, $height) = getimagesize($portada);
  16.  
  17. imagecopyresized($portada, $imagen, 0, 0, 0, 0, $ancho, $alto, 0, 0);
  18.  
  19. imagettftext($imagen, 15, 0, 234, 42, $amarillo, $fuente, $titulo);
  20. imagettftext($imagen, 15, 0, 220, 70, $amarillo, $fuente, $peso);
  21. imagettftext($imagen, 15, 0, 260, 95, $amarillo, $fuente, $servidor);
  22. imagettftext($imagen, 15, 0, 250, 120, $amarillo, $fuente, $genero);
  23.  
  24. Header ("Content-type: image/jpeg");
  25. ImageJPEG ($imagen);
  26. ImageDestroy($imagen);
  27. ?>

Gracias de antemano :D