Ver Mensaje Individual
  #6 (permalink)  
Antiguo 15/04/2008, 15:04
Avatar de GatorV
GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 20 años, 3 meses
Puntos: 2135
Re: Problema con librería gd

Prueba así:
Código PHP:
<?php
function LoadJpeg($imgname)
{
    
$im = @imagecreatefromjpeg($imgname); /* Attempt to open */
    
if (!$im) { /* See if it failed */
        
$im  = imagecreatetruecolor(150, 30); /* Create a black image */
        
$bgc = imagecolorallocate($im, 255, 255, 255);
        
$tc  = imagecolorallocate($im, 0, 0, 0);
        
imagefilledrectangle($im, 0, 0, 150, 30, $bgc);
        
/* Output an errmsg */
        
imagestring($im, 1, 5, 5, "Error loading $imgname", $tc);
    }
    return 
$im;
}
header("Content-Type: image/jpeg");
$archivo = $_SERVER['DOCUMENT_ROOT'] . "/8.jpg";
$imagen = LoadJpeg($archivo);
imagejpeg($imagen, "8_thumb.jpg");
imagedestroy($imagen);
?>
Saludos.