|
From: Florin C B. <ory...@us...> - 2013-03-19 02:01:52
|
Update of /cvsroot/mxbb/mx_smartor/album_mod/modules In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv31576/modules Modified Files: album_pic.php album_picm.php album_upload.php Log Message: Album Image Class Update to partialy support the other type of images Index: album_pic.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_pic.php,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** album_pic.php 18 Mar 2013 20:58:58 -0000 1.10 --- album_pic.php 19 Mar 2013 02:01:49 -0000 1.11 *************** *** 343,347 **** case '.xbm': $file_header = 'Content-type: image/xbm'; ! $read_function = 'imagecreatefromwxbm'; $send_function = 'SendToBrowser'; break; --- 343,347 ---- case '.xbm': $file_header = 'Content-type: image/xbm'; ! $read_function = 'imagecreatefromxbm'; $send_function = 'SendToBrowser'; break; Index: album_upload.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_upload.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** album_upload.php 23 Dec 2008 06:59:33 -0000 1.7 --- album_upload.php 19 Mar 2013 02:01:49 -0000 1.8 *************** *** 21,27 **** } - - - if ($album_config['switch_nuffload'] == 1) { --- 21,24 ---- *************** *** 751,755 **** // Get File Upload Info // -------------------------------- - $filetype = $upload_files['type'][$index]; $filesize = $upload_files['size'][$index]; --- 748,751 ---- *************** *** 800,804 **** // Check file size // -------------------------------- - $recompress = 0; if ( ($album_config['dynamic_pic_resampling'] == 1) && (intval($album_config['max_file_size_resampling']) > intval($album_config['max_file_size'])) && ($album_config['switch_nuffload'] == 0) ) --- 796,799 ---- *************** *** 833,837 **** // Check file type // -------------------------------- - switch ($filetype) { --- 828,831 ---- *************** *** 844,849 **** } $pic_filetype = '.jpg'; ! break; ! case 'image/png': case 'image/x-png': --- 838,842 ---- } $pic_filetype = '.jpg'; ! break; case 'image/png': case 'image/x-png': *************** *** 853,858 **** } $pic_filetype = '.png'; ! break; ! case 'image/gif': if ($album_config['gif_allowed'] == 0) --- 846,850 ---- } $pic_filetype = '.png'; ! break; case 'image/gif': if ($album_config['gif_allowed'] == 0) *************** *** 861,865 **** } $pic_filetype = '.gif'; ! break; default: mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); --- 853,879 ---- } $pic_filetype = '.gif'; ! break; ! case 'image/xbm': ! if ($album_config['gif_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $pic_filetype = '.xbm'; ! break; ! case 'image/wbmp': ! case 'image/vnd.wap.wbmp': ! if ($album_config['gif_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $pic_filetype = '.wbmp'; ! break; ! case 'image/bmp': ! if ($album_config['gif_allowed'] == 0) ! { ! mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); ! } ! $pic_filetype = '.bmp'; ! break; default: mx_message_die(GENERAL_ERROR, $lang['Not_allowed_file_type']); *************** *** 886,896 **** // Generate filename // -------------------------------- - srand((double)microtime()*1000000); // for older than version 4.2.0 of PHP - do { $pic_filename = md5(uniqid(rand())) . $pic_filetype; } while( file_exists(ALBUM_UPLOAD_PATH . $pic_filename) ); --- 900,909 ---- // Generate filename // -------------------------------- srand((double)microtime()*1000000); // for older than version 4.2.0 of PHP do { $pic_filename = md5(uniqid(rand())) . $pic_filetype; } + while( file_exists(ALBUM_UPLOAD_PATH . $pic_filename) ); *************** *** 904,908 **** // Move this file to upload directory // -------------------------------- - $ini_val = ( @phpversion() >= '4.0.0' ) ? 'ini_get' : 'get_cfg_var'; --- 917,920 ---- *************** *** 933,939 **** @unlink($filetmp); } - @chmod(ALBUM_UPLOAD_PATH . $pic_filename, 0777); - if ($album_config['gd_version'] == 0) { --- 945,949 ---- *************** *** 943,953 **** } - // -------------------------------- // Well, it's an image. Check its image size // -------------------------------- - $pic_size = getimagesize(ALBUM_UPLOAD_PATH . $pic_filename); - $pic_width = $pic_size[0]; $pic_height = $pic_size[1]; --- 953,960 ---- *************** *** 968,972 **** // Resize on upload ! if ( ((($pic_width > $album_config['max_width']) || ($pic_height > $album_config['max_height'])) || ($recompress == 1)) && ($pic_filetype != '.gif')) { if ($album_config['gd_version'] == 0) --- 975,979 ---- // Resize on upload ! if ( ((($pic_width > $album_config['max_width']) || ($pic_height > $album_config['max_height'])) || ($recompress == 1)) && ($pic_filetype != '.xbmp')) { if ($album_config['gd_version'] == 0) *************** *** 980,991 **** switch ($pic_filetype) { ! case '.jpg': ! $read_function = 'imagecreatefromjpeg'; ! break; case '.png': ! $read_function = 'imagecreatefrompng'; ! break; } - $src = @$read_function(ALBUM_UPLOAD_PATH . $pic_filename); --- 987,1009 ---- switch ($pic_filetype) { ! case '.gif': ! $read_function = 'imageCreateFromGIF'; ! break; ! case '.jpeg': ! $read_function = 'imageCreateFromJPEG'; ! break; case '.png': ! $read_function = 'imageCreateFromPNG'; ! break; ! case '.wbmp': ! $read_function = 'imageCreateFromWBMP'; ! break; ! case '.bmp': ! $read_function = 'ImageCreateFromBMP'; ! break; ! default: ! $ermsg = $pic_filetype .' images are not supported<br />'; ! break; } $src = @$read_function(ALBUM_UPLOAD_PATH . $pic_filename); *************** *** 1199,1203 **** { $pic_thumbnail = $pic_filename; - // Write to disk switch ($pic_filetype) --- 1217,1220 ---- *************** *** 1210,1214 **** break; } - @chmod(ALBUM_CACHE_PATH . $pic_thumbnail, 0777); --- 1227,1230 ---- Index: album_picm.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_picm.php,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** album_picm.php 18 Mar 2013 21:38:44 -0000 1.11 --- album_picm.php 19 Mar 2013 02:01:49 -0000 1.12 *************** *** 306,310 **** break; case '.wbmp': ! $file_header = 'Content-type: image/wbmp'; $read_function = 'ReadSourceFile'; $send_function = 'SendToBrowser'; --- 306,310 ---- break; case '.wbmp': ! $file_header = 'Content-Type: image/vnd.wap.wbmp'; $read_function = 'ReadSourceFile'; $send_function = 'SendToBrowser'; |