Changeset 4897 for extensions/upload_form/include/functions_upload.inc.php
- Timestamp:
- Feb 16, 2010, 11:32:20 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/upload_form/include/functions_upload.inc.php
r4875 r4897 18 18 // 4) register in database 19 19 20 $page['max_width'] = 800;21 $page['max_height'] = 800;22 23 $page['thumb_width'] = 128;24 $page['thumb_height'] = 96;25 26 $page['source_file'] = '/home/pierrick/public_html/test/resize/phpthumb/examples/statue_small.jpg';27 28 20 function add_uploaded_file($source_filepath, $original_filename=null, $categories=null, $level=null) 29 21 { 30 global $ page;22 global $conf; 31 23 32 24 // current date … … 59 51 } 60 52 61 if (need_resize($file_path, $page['max_width'], $page['max_height'])) 53 if ($conf['upload_form_websize_resize'] 54 and need_resize($file_path, $conf['upload_form_websize_maxwidth'], $conf['upload_form_websize_maxheight'])) 62 55 { 63 56 $high_path = file_path_for_type($file_path, 'high'); … … 68 61 $high_infos = pwg_image_infos($high_path); 69 62 70 pwg_image_resize($high_path, $file_path, $page['max_width'], $page['max_height']); 63 pwg_image_resize( 64 $high_path, 65 $file_path, 66 $conf['upload_form_websize_maxwidth'], 67 $conf['upload_form_websize_maxheight'], 68 $conf['upload_form_websize_quality'] 69 ); 71 70 } 72 71 … … 76 75 $thumb_dir = dirname($thumb_path); 77 76 prepare_directory($thumb_dir); 78 pwg_image_resize($file_path, $thumb_path, $page['thumb_width'], $page['thumb_height']); 77 78 pwg_image_resize( 79 $file_path, 80 $thumb_path, 81 $conf['upload_form_thumb_maxwidth'], 82 $conf['upload_form_thumb_maxheight'], 83 $conf['upload_form_thumb_quality'] 84 ); 85 79 86 $thumb_infos = pwg_image_infos($thumb_path); 80 87 … … 163 170 } 164 171 165 function pwg_image_resize($source_filepath, $destination_filepath, $max_width, $max_height )172 function pwg_image_resize($source_filepath, $destination_filepath, $max_width, $max_height, $quality) 166 173 { 167 174 if (!function_exists('gd_info')) … … 230 237 ); 231 238 232 imagejpeg($destination_image, $destination_filepath, 95);239 imagejpeg($destination_image, $destination_filepath, $quality); 233 240 // freeing memory ressources 234 241 imagedestroy($source_image);
Note: See TracChangeset
for help on using the changeset viewer.