hi,
du scheinst ja scho a bissal ahnung von php zu haben.
ich hab mir nich alles durchgelesen, aber machs sonst mal so (isn script von mir, mit gb-lib)
$thumb_breite = 128; ## wie breit soll das bild werden ?
$thumb_dest = "images/referenzen/thumbs/"; ## wo soll das bild gespeichert werden bzw welches präfix soll verwendet werden ?
##(slash nicht vergessen)
function do_thumb($original) {
global $thumb_breite, $thumb_dest;
$orig = explode("/", $original);
$orig = array_reverse($orig);
$original_bild = $orig[0];
$daten = getimagesize($original);
$orig_breite = $daten[0];
$orig_hoehe = $daten[1];
$skalierung = $orig_hoehe/$orig_breite;
$thumb_hoehe = $skalierung*$thumb_breite;
## gif
if($daten[2] == 1) {
$orig_grafik = ImageCreateFromGIF($original);
$thumb_grafik = ImageCreateTrueColor($thumb_breite, $thumb_hoehe);
ImageCopyResized($thumb_grafik, $orig_grafik, 0, 0, 0, 0, $thumb_breite, $thumb_hoehe, $orig_breite, $orig_hoehe);
ImageGIF($thumb_grafik, $thumb_dest.$original_bild);
return true;
}
## jpeg
elseif($daten[2] == 2) {
$orig_grafik = ImageCreateFromJPEG($original);
$thumb_grafik = ImageCreateTrueColor($thumb_breite, $thumb_hoehe);
ImageCopyResized($thumb_grafik, $orig_grafik, 0, 0, 0, 0, $thumb_breite, $thumb_hoehe, $orig_breite, $orig_hoehe);
ImageJPEG($thumb_grafik, $thumb_dest.$original_bild);
return true;
}
else {
return false;
}
}
Alles anzeigen