Changeset 12175 for trunk/include/ws_functions.inc.php
- Timestamp:
- Sep 17, 2011, 11:03:58 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/ws_functions.inc.php
r11962 r12175 2963 2963 2964 2964 $query=' 2965 SELECT id, path, tn_ext, has_high 2965 SELECT id, path, tn_ext, has_high, width, height 2966 2966 FROM '.IMAGES_TABLE.' 2967 2967 WHERE id = '.(int)$params['image_id'].' … … 2975 2975 2976 2976 $image_path = $image['path']; 2977 2978 if (!is_valid_image_extension(get_extension($image_path))) 2979 { 2980 return new PwgError(403, "image can't be resized"); 2981 } 2982 2977 2983 $hd_path = get_high_path($image); 2978 2984 2979 if (empty($image['has_high']) or !file_exists($hd_path) or !is_valid_image_extension(get_extension($image_path))) 2980 { 2981 return new PwgError(403, "image can't be resized"); 2985 if (empty($image['has_high']) or !file_exists($hd_path)) 2986 { 2987 if ($image['width'] > $params['maxwidth'] or $image['height'] > $params['maxheight']) 2988 { 2989 $hd_path = file_path_for_type($image_path, 'high'); 2990 $hd_dir = dirname($hd_path); 2991 prepare_directory($hd_dir); 2992 2993 rename($image_path, $hd_path); 2994 $hd_infos = pwg_image_infos($hd_path); 2995 2996 single_update( 2997 IMAGES_TABLE, 2998 array( 2999 'has_high' => 'true', 3000 'high_filesize' => $hd_infos['filesize'], 3001 'high_width' => $hd_infos['width'], 3002 'high_height' => $hd_infos['height'], 3003 ), 3004 array( 3005 'id' => $image['id'] 3006 ) 3007 ); 3008 } 3009 else 3010 { 3011 return new PwgError(403, "image can't be resized"); 3012 } 2982 3013 } 2983 3014
Note: See TracChangeset
for help on using the changeset viewer.