<?php
function thumbnail($img_src_str) {
global $row_conf;
$img_src = './' . $row_conf['CONTAIN'] . '/' . $img_src_str;
$im = imagecreatefromjpeg($img_src);

list($src_width, $src_height) = getimagesize($img_src);

if($src_width >= $src_height) 
{ 
   $new_image_width = 120;
   $new_image_height = $src_height * 150 / $src_width;
}
if($src_width < $src_height) 
{
   $new_image_height = 120;
   $new_image_width = $src_width * 150 / $src_height;
}

$new_image = imagecreatetruecolor($new_image_width, $new_image_height);
imagecopyresampled($new_image, $im, 0, 0, 0, 0, $new_image_width,$new_image_height, $src_width, $src_height);
imagejpeg($new_image,"./thumb/$img_src_str", 100);

}


?>
