<br />
<b>Warning</b>: getimagesize(foto000.jpg) [<a href='function.getimagesize'>function.getimagesize </a>]: failed to open stream: No such file or directory in <b>/photos/foto.php</b> on line <b>14</b><br />
<br />
<b>Warning</b>: imagecreate() [<a href='function.imagecreate'>function.imagecreate</a>]: Invalid image dimensions in <b>/photos/foto.php</b> on line <b>24</b><br />
<br />
<b>Warning</b>: imagecreatetruecolor() [<a href='function.imagecreatetruecolor'>function.imag ecreatetruecolor</a>]: Invalid image dimensions in <b>/photos/foto.php</b> on line <b>25</b><br />
<br />
<b>Warning</b>: imagecreatefromjpeg(foto000.jpg) [<a href='function.imagecreatefromjpeg'>function.image createfromjpeg</a>]: failed to open stream: No such file or directory in <b>/photos/foto.php</b> on line <b>26</b><br />
<br />
<b>Warning</b>: imagecopyresized(): supplied argument is not a valid Image resource in <b>/photos/foto.php</b> on line <b>29</b><br />
El código que tengo es el siguiente:
Código PHP:
// Variables que indican el archivo de la imagen y el nuevo tamano
if ($id < 10) { $id = "000".$id; }
elseif ($id < 100) { $id = "00".$id; }
elseif ($id < 1000) { $id = "0".$id; }
$filename = 'foto'.$id.'.jpg';
$percent = 1;
// Content-type para el navegador
header('Content-type: image/jpeg');
// Se obtienen las nuevas dimensiones
list($width, $height) = getimagesize($filename);
if ($type=="low") {
$newwidth = "118";
$newheight = "88";
}
else {
$newwidth = $width * $percent;
$newheight = $height * $percent;
}
// Cargar la imagen
$thumb = imagecreate($newwidth, $newheight);
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg($filename);
// Redimensionar
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
// Mostrar la nueva imagen
//imagejpeg($thumb);
Alguien sabe a que puede deberse que falle de golpe el codigo tanto en mi servidor local, como en el externo?