
Zitat von
Hoobert
...gibt es eigentlich auch eine Möglichkeit, Fotos im Hochformat als Hintergrundbild vernünftig anzuzeigen?...
Hallo,
folgende Zeilen müsstet ihr in die index.php an den entsprechenden Stellen einfügen bzw. abändern (die Punkte sollen Auslassungen andeuten):
Code:
$backgroundcol = ImageColorAllocate($im, 0, 0, 0); //schwarz anstatt weiß
...
list($orig_width, $orig_height) = getimagesize($bgimagefile);
...
$orig_ratio = $orig_width/$orig_height;
if ($bg){
if($orig_ratio >= 1){
//querformat
imagecopyresampled($im, $bg, 0, 0, 0, 0, $image_width, $image_height, imagesx($bg), imagesy($bg));
} else {
//hochformat
imagecopyresampled($im, $bg, ($image_width-$orig_width)/2, 0, 0, 0, $orig_width, $image_height, imagesx($bg), imagesy($bg));
}
}
...
Die Bilder im Hochformat sind bei mir 450x600 px groß (dürfen halt nicht höher als 600 sein, sonst gibt's nen Fehler).
Gruß
Hoobert