Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/12/2011, 20:50
AlvaroX
 
Fecha de Ingreso: septiembre-2008
Mensajes: 242
Antigüedad: 15 años, 7 meses
Puntos: 3
imagen php chrome

hola tengo el siguente codigo para mostrar una imagen

<?php
include("includes/mysql.php");
$link=mysql_connect($dataMysql[0], $dataMysql[1], $dataMysql[2]);
if($link && mysql_select_db($dataMysql[3])){
$id= saveMysql($_GET["id"]);
$q = mysql_query("SELECT * FROM imagescar WHERE id='$id'");
$datos = mysql_fetch_array($q);
header("Content-length: ".$datos['size']);
header("Content-Disposition: inline; filename=".$datos['name']);
header("Content-type: ".$datos['type']);
$c=$datos['content'];

$im = imagecreatefromstring($c);
$x1 = imagesx($im);
$y1 = imagesy($im);
$x = $x1;
$y = $y1;
if($x*$y > 160000){
while(true){
$x=$x-round($x/20);
$y=$y-round($y/20);
if($x*$y <= 160000){
break;
}
}
$new = imagecreatetruecolor($x, $y);
imagecopyresampled($new, $im, 0, 0, 0, 0, $x, $y, $x1, $y1);
imagedestroy($im);
imagejpeg($new, null, 100);
}
else{
echo $c;
}
}
?>

y lo muestro asi

<img src="img.php?id=id_foto" />

el problema es que en google chrome me carga la foto luego la quita (la imagen no aparece y aparece el icono de imagen no el icono de imagen cortada)

que podra ser?