#list($width, $height) = getimagesize($filename);
$img =
getimagesize($filename);
$width = $img[0];
$height= $img[1];
$img_type =
$img['mime'];
$newwidth = $width * $percent;
$newheight = $height * $percent;


$img_type göre
image/jpeg
$source = imagecreatefromjpeg($filename);
image/png
$source = imagecreatefrompng($filename);
image/gif
$source = imagecreatefromgif($filename);

imagejpeg($thumb,'asd.jpg',85); // 100 kullanma
imagepng($thumb,'asd.png');
imagegif($thumb,'asd.gif');

kolay gelsin