|
From: Florin C B. <ory...@us...> - 2013-03-19 06:43:47
|
Update of /cvsroot/mxbb/mx_smartor/album_mod/modules In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv13052 Modified Files: album_picm.php Log Message: fixed thumb generation for bmp to png Index: album_picm.php =================================================================== RCS file: /cvsroot/mxbb/mx_smartor/album_mod/modules/album_picm.php,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** album_picm.php 19 Mar 2013 05:54:09 -0000 1.13 --- album_picm.php 19 Mar 2013 06:43:45 -0000 1.14 *************** *** 449,453 **** exit; } ! if (($pic_info['filetype'] == 'bmp') && @file_exists($pic_info['thumbnail_m_fullpath']) && ($album_config['show_gif_mid_thumb'] == 1)) { header('Content-type: image/bmp'); --- 449,453 ---- exit; } ! if (($pic_info['filetype'] == 'bmp') && @file_exists($pic_med_fullpath)) { header('Content-type: image/bmp'); *************** *** 458,462 **** exit; } ! //$pic_fullpath = ALBUM_UPLOAD_PATH . $pic_filename; if (!@file_exists($pic_fullpath)) { --- 458,462 ---- exit; } ! //die("$pic_med_fullpath"); if (!@file_exists($pic_fullpath)) { *************** *** 570,574 **** $resize_function = 'imagecopyresampled'; $resize_function($thumbnail, $source, 0, 0, 0, 0, $thumbnail_width, $thumbnail_height, $pic_width, $pic_height); ! if ($album_config['midthumb_cache'] == true) { // ------------------------ --- 570,574 ---- $resize_function = 'imagecopyresampled'; $resize_function($thumbnail, $source, 0, 0, 0, 0, $thumbnail_width, $thumbnail_height, $pic_width, $pic_height); ! if (($album_config['midthumb_cache'] == 1)) { // ------------------------ *************** *** 577,583 **** $pic_filetype = '.png'; $pic_med_new = md5($pic_filename) . $pic_filetype; ! $pic_med_new_fullpath = ALBUM_CACHE_PATH . $pic_med_new; @imagepng($thumbnail, $pic_med_new_fullpath); @chmod($pic_med_new_fullpath, 0777); $sql = "UPDATE ". ALBUM_TABLE ." SET pic_thumbnail = '" . $pic_med_new . "' --- 577,587 ---- $pic_filetype = '.png'; $pic_med_new = md5($pic_filename) . $pic_filetype; ! $pic_med_new_fullpath = ALBUM_MED_CACHE_PATH . $pic_med_new; ! // Re-generate successfully. Write it to disk! ! //@imagepng($thumbnail, $pic_info['thumbnail_new_m_fullpath']); ! //@chmod($pic_info['thumbnail_new_m_fullpath'], 0777); @imagepng($thumbnail, $pic_med_new_fullpath); @chmod($pic_med_new_fullpath, 0777); + /* $sql = "UPDATE ". ALBUM_TABLE ." SET pic_thumbnail = '" . $pic_med_new . "' *************** *** 587,594 **** --- 591,607 ---- mx_message_die(GENERAL_ERROR, 'Could not update pic information', '', __LINE__, __FILE__, $sql); } + */ } + else + { + @imagepng($thumbnail, $pic_info['thumbnail_new_m_fullpath']); + @chmod($pic_info['thumbnail_new_m_fullpath'], 0777); + } imagepng($thumbnail); imagedestroy($thumbnail); //readfile($pic_med_new_fullpath); + //imagepng($thumbnail); + //header("Content-Disposition: filename=thumb_" . $pic_title_reg . $pic_filetype); + //readfile($pic_nopic_fullpath); exit; } *************** *** 723,727 **** @imagejpeg($thumbnail, $pic_info['thumbnail_new_m_fullpath'], $album_config['thumbnail_quality']); break; ! case 'png': @imagepng($thumbnail, $pic_info['thumbnail_new_m_fullpath']); break; --- 736,741 ---- @imagejpeg($thumbnail, $pic_info['thumbnail_new_m_fullpath'], $album_config['thumbnail_quality']); break; ! case 'bmp': ! case 'png': @imagepng($thumbnail, $pic_info['thumbnail_new_m_fullpath']); break; *************** *** 735,739 **** @imagejpeg($thumbnail, '', $album_config['thumbnail_quality']); break; ! case 'png': @imagepng($thumbnail); break; --- 749,754 ---- @imagejpeg($thumbnail, '', $album_config['thumbnail_quality']); break; ! case 'bmp': ! case 'png': @imagepng($thumbnail); break; |