Lombi |
|
---|---|
Enjoy :)
function sed_createthumb($img_big, $img_small, $small_x, $small_y, $keepratio, $extension, $filen, $fsize, $textcolor, $textsize, $bgcolor, $bordersize, $jpegquality, $dim_priority="Width") { global $cfg; $gd_supported = array('jpg', 'jpeg', 'png', 'gif'); switch($extension) { case 'gif': $source = imagecreatefromgif($img_big); break; case 'png': $source = imagecreatefrompng($img_big); break; default: $source = imagecreatefromjpeg($img_big); break; } $thumb_size = $small_x; $width = imagesx($source); $height = imagesy($source); if($width> $height) { $x = ceil(($width - $height) / 2 ); $width = $height; } elseif($height> $width) { $y = ceil(($height - $width) / 2); $height = $width; } $new_im = ImageCreatetruecolor($thumb_size,$thumb_size); imagecopyresampled($new_im,$source,0,0,$x,$y,$thumb_size,$thumb_size,$width,$height); switch($extension) { case 'gif': imagegif($new_im, $img_small); break; case 'png': imagepng($new_im, $img_small); break; default: imagejpeg($new_im, $img_small, $jpegquality); break; } imagedestroy($new_im); imagedestroy($source); return; } <a href="http://www.domenlo.com">Surreal Art</a>
|