Aline
14.09.2006, 10:49:36
Hallo
Bitte um Hilfe. Mit folgenden Code
$img_orig_size = getimagesize($IMG_TMPNAME);
$img_orig_width = $img_orig_size[0];
$img_orig_height = $img_orig_size[1];
$thumb_width = 100;
$thumb_height = intval($img_orig_height*$thumb_width/$img_orig_width);
//# Bild erstellen
$img_resized = ImageCreateTrueColor($thumb_width, $thumb_height);
imagecopyresized($img_resized, ImageCreateFromJpeg($IMG_TMPNAME), 0 , 0 , 0 , 0, $thumb_width, $thumb_height, $img_orig_width, $img_orig_height);
Imagejpeg($img_resized, $destination, 100);
ImageDestroy($img_resized);
erstelle ich mir ein Vorschaubild mit einer Bildbreite von 100px und die Höhe variiert je nach Bild.
Nun möchte ich aber das Gegenteil, Bilder mit einer fixen Bildhöhe ($thumb_height = 100) und die Breite soll je nach Bild variieren.
Irgendwie bekomme ich das nicht hin. Kann mir da jemand bitte helfen?
Bitte um Hilfe. Mit folgenden Code
$img_orig_size = getimagesize($IMG_TMPNAME);
$img_orig_width = $img_orig_size[0];
$img_orig_height = $img_orig_size[1];
$thumb_width = 100;
$thumb_height = intval($img_orig_height*$thumb_width/$img_orig_width);
//# Bild erstellen
$img_resized = ImageCreateTrueColor($thumb_width, $thumb_height);
imagecopyresized($img_resized, ImageCreateFromJpeg($IMG_TMPNAME), 0 , 0 , 0 , 0, $thumb_width, $thumb_height, $img_orig_width, $img_orig_height);
Imagejpeg($img_resized, $destination, 100);
ImageDestroy($img_resized);
erstelle ich mir ein Vorschaubild mit einer Bildbreite von 100px und die Höhe variiert je nach Bild.
Nun möchte ich aber das Gegenteil, Bilder mit einer fixen Bildhöhe ($thumb_height = 100) und die Breite soll je nach Bild variieren.
Irgendwie bekomme ich das nicht hin. Kann mir da jemand bitte helfen?