find_extension($image) == 'jpg') $image_data = imagecreatefromjpeg($image); if($this->find_extension($image) == 'gif') $image_data = imagecreatefromgif ($image); if($this->find_extension($image) == 'png') $image_data = imagecreatefrompng ($image); // Original width && height $width = imagesx($image_data); $height = imagesy($image_data); // Control width && and height if(@$w > 800 || @$h > 800) { $w= $width; $h= $height; } /*Birol Ekleme*/ if( ($w) && (!$h) ) { $h = ( $height / $width ) * $w; } else { if(@empty($w)) $w = 140; if(@empty($h)) $h = 100; } $new = imagecreatetruecolor($w, $h); imagecopyresampled($new, $image_data, 0, 0, 0, 0, $w, $h, $width, $height); // Finally, output.. if($this->find_extension($image) == 'jpg') $image_data = imagejpeg($new); if($this->find_extension($image) == 'gif') $image_data = imagegif ($new); if($this->find_extension($image) == 'png') $image_data = imagepng ($new); // Flush memory imagedestroy($image_data); imagedestroy($new); } } $a = new yThumb(); $a->thumb($_GET["image"],@$_GET["w"],@$_GET["h"]); ?>