bu aralar nedendir bilmem icimde bir foto merakigidir gidiyor. Bunu bir hobi edindim ve kendime bir galeri yaziyorum. tabi bunu yaparkende kullaniciya resmi onizleme olarak gostermem gerek bunuda aşağıdaki fonksiyon ile yapiyorum. Resmin kalitesi düşüyor. Bu kaliteyi korumak icin ne yapmam gerekli.
public function resize($save = false , $percent , $savename = '')
{
if($this->file === FALSE) return false;
$file_information = getimagesize($this->file);
switch($file_information['mime'])
{
case 'image/jpeg':
$this->image = imagecreatefromjpeg($this->file);
break;
case 'image/png':
$this->image = imagecreatefrompng($this->file);
break;
case 'image/gif':
$this->image = imagecreatefromgif($this->file);
break;
}
$this->file_width = $file_information[0];
$this->file_height = $file_information[1];
$this->file_new_width = $this->file_width * $percent;
$this->file_new_height = $this->file_height * $percent;
$this->thumb_file = imagecreatetruecolor($this->file_new_width, $this->file_new_height);
imagecopyresampled($this->thumb_file , $this->image , 0 , 0 , 0 , 0 , $this->file_new_width, $this->file_new_height, $this->file_width, $this->file_height);
imagejpeg($this->thumb_file , $savename , 100);
}flickr'in cikarttigi thumb
buda benim ustteki kod sayesinde olusturdugum thumb

resmin orjinali
Bu 9.74 MB
simdi bu resim cok buyuk dolayisi ile ben bunun orta boy halinide resize metodundan gecirecegim ve resmin kalitesi yine orjinali gibi olmayacak. Sizce bu kaliteyi nasıl koruyabilirim ?
flicker'in orta boyu
http://www.flickr.com/photos/57239536@N04/5273934510/#/
kalite flicker kadar olmasada gd'den de iyi oldu buda bana yeter ayrica thumb olusturmak icin tek satir yetiyor hele hele watermark eklemek yeni bir dosyaya olusan resmi kaydetmek imagick sinifi ( php_imagic.so ) ile cok cok kolay ve kaliteli. Tavsiye ederim.