|
|
|
@ -8838,22 +8838,38 @@ EOD; |
|
|
|
|
$new_path = $updir . '/' . $new_file_name; |
|
|
|
|
|
|
|
|
|
//$result= @move_uploaded_file($image_array['tmp_name'], $new_path); |
|
|
|
|
|
|
|
|
|
// resize the image |
|
|
|
|
include_once (api_get_path(LIBRARY_PATH) . 'image.lib.php'); |
|
|
|
|
$temp = new image($image_array['tmp_name']); |
|
|
|
|
$picture_infos = @ getimagesize($image_array['tmp_name']); // $picture_infos[0]-> width |
|
|
|
|
if ($picture_infos[0] > 240) |
|
|
|
|
$thumbwidth = 240; |
|
|
|
|
else |
|
|
|
|
$picture_infos=@getimagesize($image_array['tmp_name']); // $picture_infos[0]-> width |
|
|
|
|
if ($picture_infos[0] > 104) { |
|
|
|
|
$thumbwidth = 104; |
|
|
|
|
} else { |
|
|
|
|
$thumbwidth = $picture_infos[0]; |
|
|
|
|
|
|
|
|
|
if ($picture_infos[1] > 100) |
|
|
|
|
$new_height = 100; |
|
|
|
|
else |
|
|
|
|
} |
|
|
|
|
if ($picture_infos[1] > 96) { |
|
|
|
|
$new_height = 96; |
|
|
|
|
} else { |
|
|
|
|
$new_height = $picture_infos[1]; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//$new_height = round(($thumbwidth/$picture_infos[0])*$picture_infos[1]); |
|
|
|
|
|
|
|
|
|
$temp->resize($thumbwidth,$new_height,0); |
|
|
|
|
$type=$picture_infos[2]; |
|
|
|
|
$result=false; |
|
|
|
|
|
|
|
|
|
switch ($type) |
|
|
|
|
{ |
|
|
|
|
case 2 : |
|
|
|
|
$result=$temp->send_image('JPG',$new_path); |
|
|
|
|
break; |
|
|
|
|
case 3 : |
|
|
|
|
$result=$temp->send_image('PNG',$new_path); |
|
|
|
|
break; |
|
|
|
|
case 1 : |
|
|
|
|
$result=$temp->send_image('GIF',$new_path); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$temp->resize($thumbwidth, $new_height, 0); |
|
|
|
|
$type = $picture_infos[2]; |
|
|
|
|