Merhaba arkadaşlar PHP de resim eklediğimde otomatik boyutlandırmak istedim mesela 1200 pixel olan resmi 253 pixel e düşürdüm kalitesi o kadar düştü ki css de 253 pixel olarak kullanıyorum bundan fazla olmasına gerek yok.

Kendim paint.net ile boyutlandırdığımda hiç bir sorun olmuyor kalitesinde en ufak bozukluk çıkmıyor acaba neden ?


function resize_image($file, $w) {
list($width, $height) = getimagesize($file);
$r = $width / $height;


$newwidth = $w;
$oran = $width / $newwidth;
$newheight = $height/$oran;

$src = imagecreatefromjpeg($file);
$dst = imagecreatetruecolor($newwidth, $newheight);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);

return $dst;
}

$img = resize_image("images/photo.jpg", "253");
imagejpeg($img, "images/resize/photo.jpg");
imagedestroy($img);