<?php
// resize function
function resize_jpg($img,$w,$h){
$thumb = imagecreate ($w, $h);
$image = ImageCreateFromJpeg($img);
$imagedata = getimagesize($img);
imagecopyresized ($thumb, $image, 0, 0, 0, 0, $w, $h, $imagedata[0], $imagedata[1]);
imagejpeg($thumb, $img);
}
// call resize function resize_jpg(image name, new width, new height)
resize_jpg("amir.jpg",600,800);
?> resim boyutlandırma sorunu...
6
●546
- 14-05-2008, 19:42:21resimleri bu altta gördüğünüz kodlarla boyutlarını değiştiriyorum. fakat resimlerin boyutları değiştiğinde resmin renkleri karışıyor, kalite çok düşüyor. bunu nasil engellerim?
- 14-05-2008, 23:09:02
- 17-05-2008, 02:36:43Kimlik doğrulama veya yönetimden onay bekliyor.Bizimlede paylaşır mısın?amirali adlı üyeden alıntı: mesajı görüntüle
- 17-05-2008, 02:57:39
<?php function boyutla($hedef{ $filename = $hedef; $percent = 0.5 ; list($width, $height) = getimagesize($filename); $newwidth = $width * $percent; $newheight = $height * $percent; $thumb = imagecreatetruecolor($newwidth, $newheight); $source = imagecreatefromjpeg($filename); imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); imagejpeg($thumb,$hedef,'100'); } ?>gibi...
