= ($thumbBreite+1) ? $thumbBreite : $size[0]; $height = $width*($size[1]/$size[0]); if($height >= ($thumbHeight+1)) { $height = $thumbHeight; $width = ($size[0]/$size[1])*$height; } // Bild laden if(substr($file,-4) == '.png'){ $old_picture = imagecreatefrompng($file); }else{ $old_picture = imagecreatefromjpeg($file); } // Neues Bild erzeugen $new_picture = imagecreatetruecolor($width, $height); // Kopiert das Ursprungsbild und formatiert es um + Weichzeichnung. imagecopyresampled($new_picture, $old_picture, 0, 0, 0, 0, $width, $height, $size[0], $size[1]); // Bild ausgeben imagejpeg($new_picture); ?>