$maxWidth) { $imgSize[1] *= $maxWidth / $imgSize[0]; $imgSize[0] = $maxWidth; } if($imgSize[1] > $maxHeight) { $imgSize[0] *= $maxHeight / $imgSize[1]; $imgSize[1] = $maxHeight; } if(function_exists('imagecreatetruecolor')) { $thumbnail = imagecreatetruecolor($imgSize[0], $imgSize[1]); imagecopyresampled($thumbnail, $image, 0, 0, 0, 0, $imgSize[0], $imgSize[1], $oldSize[0], $oldSize[1]); } else { $thumbnail = imagecreate($imgSize[0], $imgSize[1]); imagecopyresized($thumbnail, $image, 0, 0, 0, 0, $imgSize[0], $imgSize[1], $oldSize[0], $oldSize[1]); } imagedestroy($image); if($output == '') header('Content-type: image/jpeg'); imagejpeg($thumbnail, $output, 80); imagedestroy($thumbnail); } thumbnail('Beispiel.jpg', 100, 100); ?>