Ver Mensaje Individual
  #6 (permalink)  
Antiguo 09/01/2004, 22:06
jmaribau
 
Fecha de Ingreso: enero-2004
Mensajes: 235
Antigüedad: 20 años, 3 meses
Puntos: 0
I no da ningun error de php, sólo las imagenes que no aparecen.
Si claro, que lo he comprovado le he passado el debugger, y esta perfecto. Tal como tiene que ser. Pero en el navegador, no envia la imagen o no se que debe de passar pero no salen las imagenes como si el src='....' no fuera el correcto. el Source es una llamada a esta funcion php.

Pondré el código entero:
if ($_GET['src']) {
$valores = array('method','ruta','ancho','alto','guardar','ca lidad');
$i=0;
foreach ($_GET as $key=>$val) {
$$valores[$i++]=$val;
}
unset($i,$key,$val);
if (!$calidad) $calidad = 85;

$prop=GetImageSize($ruta);
$img_ancho = $prop[0];
$img_alto = $prop[1];
$img_tipo = $prop[mime];

$gd_function_suffix = array(
'image/pjpeg'=>'JPEG',
'image/jpeg' =>'JPEG',
'image/gif' =>'GIF' ,
'image/bmp' =>'WBMP',
'image/x-png'=>'PNG');

$function_suffix = $gd_function_suffix[$img_tipo];
$function_to_read = 'ImageCreateFrom'.$function_suffix;
$function_to_write = 'Image'.$function_suffix;

$fuente = $function_to_read($ruta);
$fuente = ImageCreateFromJPEG($ruta);
//$imgAncho = ImageSx($fuente);
//$imgAlto =ImageSy($fuente);
$func='imagecreatetruecolor';
if (!Function_Exists($func)) {
$imagen=ImageCreate($ancho,$alto);
ImageCopyResized($imagen,$fuente,0,0,0,0,$ancho,$a lto,$img_ancho,$img_alto);
} else {
$imagen = ImageCreateTrueColor($ancho,$alto);
if ($metod) {
ImageCopyResized($imagen,$fuente,0,0,0,0,$ancho,$a lto,$img_ancho,$img_alto);
} else {
ImageCopyResampled($imagen,$fuente,0,0,0,0,$ancho, $alto,$img_ancho,$img_alto);
}
}

$nombre=BaseName($_GET['src']);
if (!$guardar) {
Header("Content-type: $img_tipo");
Header("Content-Disposition: inline; filename=$nombre;");
} else {
$guardarendisco=$nombre;
}
//$function_to_write($imagen,$guardarendisco,$calida d);
ImageJpeg($imagen,$guardarendisco,$calidad);
imageDestroy($imagen);