matthiasschnueriger
Erfahrenes Mitglied
Guten Abend
Mit einem File namens thumbdir.php öffne ich meine Bilder als Thumnails.
Ich bekomme aber folgendes Warning:
Wo liegt wohl der Fehler?
der ganze Code sieht so aus:
Gruss Matthias
Mit einem File namens thumbdir.php öffne ich meine Bilder als Thumnails.
Ich bekomme aber folgendes Warning:
PHP:
Warning: getimagesize(): Read error! in /home/www/web299/html/schellen-ursli-neu/gallerien/snowboardpics/thumbdir.php on line 53
Wo liegt wohl der Fehler?
der ganze Code sieht so aus:
PHP:
function createimage($width, $height){
$imgh = imagecreate($width, $height);
$bgc = imagecolorallocate($imgh, 230, 230, 230);
return $imgh;
}
if($path){ // Thumbnail
$height = 60; // Maximalhöhe
$width = 90; // Maximalbreite
$img_size = getimagesize($path);
$imgh = ImageCreateTrueColor($width, $height);
$imgh2 = imagecreatefromjpeg($path);
$black = imagecolorallocate($imgh2, 0, 0, 0);
imagecopyresampled($imgh, $imgh2, 0, 0, 0, 0, $width, $height, $img_size[0], $img_size[1]);
header("Content-Type: image/jpeg");
imagejpeg($imgh, '', 100);
imagedestroy($imgh);
} else { // Dateianzeige
$mydir = dir("./");
while($file=$mydir->read()) {
if(getimagesize($path)){
echo'<a href="gallerien_bigpic.php?pic='.$file. '"><img src="' . $PHP_SELF . '?path=' . $file . '"></a> ';
}
}
}
Gruss Matthias