imagesx($orgineel)) { $klein_hoogte = $_GET['afmeting']; $klein_breedte = round(imagesx($orgineel) / (imagesy($orgineel) / $_GET['afmeting'])); } elseif(imagesy($orgineel) == imagesx($orgineel)) { $klein_hoogte = $_GET['afmeting']; $klein_breedte = $_GET['afmeting']; } elseif(imagesy($orgineel) < imagesx($orgineel)) { $klein_breedte = $_GET['afmeting']; $klein_hoogte = round(imagesy($orgineel) / (imagesx($orgineel) / $_GET['afmeting'])); } else exit; $klein = imagecreatetruecolor($klein_breedte, $klein_hoogte); imagecopyresized($klein, $orgineel, 0, 0, 0, 0, $klein_breedte, $klein_hoogte, imagesx($orgineel), imagesy($orgineel)); if(file_exists("fotos/".$_GET['foto'].".jpg")) imagejpeg($klein); elseif(file_exists("fotos/".$_GET['foto'].".gif")) imagegif($klein); else imagepng($klein); imagedestroy($orgineel); ?> if(file_exists("fotos/".$_GET['foto'].".jpg")) { header("Content-type: image/jpeg"); $orgineel = imagecreatefromjpeg("fotos/".$_GET['foto'].".jpg"); } elseif(file_exists("fotos/".$_GET['foto'].".gif")) { header("Content-type: image/gif"); $orgineel = imagecreatefromgif("fotos/".$_GET['foto'].".gif"); } else { header("Content-type: image/png"); $orgineel = imagecreatefrompng("fotos/".$_GET['foto'].".png"); } if(imagesy($orgineel) <= $_GET['afmeting'] && imagesx($orgineel) <= $_GET['afmeting']) { $klein_hoogte = imagesy($orgineel); $klein_breedte = imagesx($orgineel); } elseif(imagesy($orgineel) > imagesx($orgineel)) { $klein_hoogte = $_GET['afmeting']; $klein_breedte = round(imagesx($orgineel) / (imagesy($orgineel) / $_GET['afmeting'])); } elseif(imagesy($orgineel) == imagesx($orgineel)) { $klein_hoogte = $_GET['afmeting']; $klein_breedte = $_GET['afmeting']; } elseif(imagesy($orgineel) < imagesx($orgineel)) { $klein_breedte = $_GET['afmeting']; $klein_hoogte = round(imagesy($orgineel) / (imagesx($orgineel) / $_GET['afmeting'])); } else exit; $klein = imagecreatetruecolor($klein_breedte, $klein_hoogte); imagecopyresized($klein, $orgineel, 0, 0, 0, 0, $klein_breedte, $klein_hoogte, imagesx($orgineel), imagesy($orgineel)); if(file_exists("fotos/".$_GET['foto'].".jpg")) imagejpeg($klein); elseif(file_exists("fotos/".$_GET['foto'].".gif")) imagegif($klein); else imagepng($klein); imagedestroy($orgineel); ?>