$simg = imagecreatefromjpeg($dosyacik); // Make A New Temporary Image To Create The Thumbanil From
$currwidth = imagesx($simg); // Current Image Width
$currheight = imagesy($simg); // Current Image Height
if($currwidth > $twidth2){ // Eğer Resim Fazla Büyükse
if ($currheight > $currwidth) { // If Height Is Greater Than Width
$zoom = $twidth2 / $currheight; // Length Ratio For Width
$newheight = $theight2; // Height Is Equal To Max Height
$newwidth = $currwidth * $zoom; // Creates The New Width
}// Yükseklik Genişlikten Büyükse
else{ // Otherwise, Assume Width Is Greater Than Height (Will Produce Same Result If Width Is Equal To Height)
$zoom = $twidth2 / $currwidth; // Length Ratio For Height
$newwidth = $twidth2; // Width Is Equal To Max Width
$newheight = $currheight * $zoom; // Creates The New Height
} // Yükseklik Genişlikten Büyük Değilse
$dimg = imagecreate($newwidth, $newheight); // Make New Image For Thumbnail
imagetruecolortopalette($simg, false, 256); // Create New Color Pallete
$palsize = ImageColorsTotal($simg);
for ($i = 0; $i < $palsize; $i++) { // Counting Colors In The Image
$colors = ImageColorsForIndex($simg, $i); // Number Of Colors Used
ImageColorAllocate($dimg, $colors['red'], $colors['green'], $colors['blue']);
} // For
imagecopyresized($dimg, $simg, 0, 0, 0, 0, $newwidth, $newheight, $currwidth, $currheight);fonksiyonun içindeki resize bölümü neyin neye yaradığını biliyorum fakat kalitenin neden bozulduğunu bilmiyorum yardımcı olursanız sevinirim
Resim Resize Yardım !!
6
●579
- 21-11-2008, 14:21:00Arkadaşlar bir ara bir upload fonksiyonu bulmuştum.Onun resizesini kullanıyorum fakat onunki boyutu değiştirir değiştirmez resmi bi garip gösteriyor.Kalitesi acaip bozuluyor.
- 21-11-2008, 15:33:16Yok dostum Thumbs resmi zaten net olmasada olur ben facebook mantığıyla yapıyorum yani sayfanın şeklini bozmaması için 500 genişlik 400 yükseklik sınırı koyuyorum ona orantılı resmi sınıra yaslıyor. 604x453 lük resmi 500x375 yapıyor yani bu resimde bile %100 netlik gidiyor 3 Boyutlu gibi oluyor =)