Changeset 1005 for trunk/expressoMail1_2/inc
- Timestamp:
- 06/18/09 09:24:17 (15 years ago)
- Location:
- trunk/expressoMail1_2/inc
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.imap_functions.inc.php
r1000 r1005 1052 1052 if (($file_type == 'image/jpeg') || ($file_type == 'image/pjpeg') || ($file_type == 'image/gif') || ($file_type == 'image/png')) { 1053 1053 $img = "<IMG id='".$msg_folder.";;".$msg_number.";;".$i.";;".$msg->pid[$msg_number][$index].";;".$msg->encoding[$msg_number][$index]."' style='border:2px solid #fde7bc;padding:5px' title='".$this->functions->getLang("Click here do view (+)")."'src=./inc/show_thumbs.php?file_type=".$file_type."&msg_num=".$msg_number."&msg_folder=".$msg_folder."&msg_part=".$msg->pid[$msg_number][$index].">"; 1054 $href = "<a onMouseDown='save_image(event,this )' href='#".$msg_folder.";;".$msg_number.";;".$i.";;".$msg->pid[$msg_number][$index].";;".$msg->encoding[$msg_number][$index]."' onClick=\"window.open('./inc/show_img.php?msg_num=".$msg_number."&msg_folder=".$msg_folder."&msg_part=".$msg->pid[$msg_number][$index]."','mywindow','width=700,height=600,scrollbars=yes');\">". $img ."</a>";1054 $href = "<a onMouseDown='save_image(event,this,\"".$file_type."\")' href='#".$msg_folder.";;".$msg_number.";;".$i.";;".$msg->pid[$msg_number][$index].";;".$msg->encoding[$msg_number][$index]."' onClick=\"window.open('./inc/show_img.php?msg_num=".$msg_number."&msg_folder=".$msg_folder."&msg_part=".$msg->pid[$msg_number][$index]."','mywindow','width=700,height=600,scrollbars=yes');\">". $img ."</a>"; 1055 1055 $thumbs_array[] = $href; 1056 1056 } … … 2032 2032 2033 2033 // Build Uploading Attachments!!! 2034 if (count($attachments)) 2035 foreach ($attachments as $attach) 2036 $mail->AddAttachment($attach['tmp_name'], $attach['name'], "base64", $this->get_file_type($attach['name'])); // optional name 2034 $sizeof_attachments = count($attachments); 2035 if ($sizeof_attachments) 2036 foreach ($attachments as $numb => $attach){ 2037 if ($numb == ($sizeof_attachments-1) && $params['insertImg'] == 'true'){ // Auto-resize image 2038 list($width, $height,$image_type) = getimagesize($attach['tmp_name']); 2039 switch ($image_type) 2040 { 2041 case 1: $image_big = imagecreatefromgif($attach['tmp_name']); break; 2042 case 2: $image_big = imagecreatefromjpeg($attach['tmp_name']); break; 2043 case 3: $image_big = imagecreatefrompng($attach['tmp_name']); break; 2044 case 6: 2045 include_once("gd_functions.php"); 2046 $image_big = imagecreatefrombmp($attach['tmp_name']); break; 2047 default: 2048 $mail->AddAttachment($attach['tmp_name'], $attach['name'], "base64", $this->get_file_type($attach['name'])); 2049 break; 2050 } 2051 header('Content-type: image/jpeg'); 2052 $max_resolution = $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['image_size']; 2053 $max_resolution = ($max_resolution==""?'65536':$max_resolution); 2054 if ($width < $max_resolution && $height < $max_resolution){ 2055 $new_width = $width; 2056 $new_height = $height; 2057 } 2058 else if ($width > $max_resolution){ 2059 $new_width = $max_resolution; 2060 $new_height = $height*($new_width/$width); 2061 } 2062 else { 2063 $new_height = $max_resolution; 2064 $new_width = $width*($new_height/$height); 2065 } 2066 $image_new = imagecreatetruecolor($new_width, $new_height); 2067 imagecopyresampled($image_new, $image_big, 0, 0, 0, 0, $new_width, $new_height, $width, $height); 2068 $tmpDir = ini_get("session.save_path"); 2069 $_file = "cid_image_".base_convert(microtime(), 10, 36).".dat"; 2070 imagejpeg($image_new,$tmpDir.$_file, 85); 2071 $mail->AddAttachment($tmpDir.$_file, $attach['name'], "base64", $this->get_file_type($tmpDir.$_file)); 2072 } 2073 else 2074 $mail->AddAttachment($attach['tmp_name'], $attach['name'], "base64", $this->get_file_type($attach['name'])); 2075 // optional name 2076 } 2077 2037 2078 2038 2079 -
trunk/expressoMail1_2/inc/gotodownload.php
r178 r1005 1 1 <? 2 if (! array_key_exists('phpgw_info', $_SESSION)) 3 exit; 4 2 5 $msg_number = $_GET['msg_number']; 3 6 $idx_file = $_GET['idx_file']; … … 25 28 $mbox_stream = imap_open("{".$imap_server.":".$imap_port.$imap_options."}".$msg_folder, $username, $password); 26 29 $fileContent = imap_fetchbody($mbox_stream, $msg_number, $msg_part, FT_UID); 27 include("class.imap_attachment.inc.php"); 28 $imap_attachment = new imap_attachment(); 29 $a = $imap_attachment->download_attachment($mbox_stream, $msg_number); 30 31 $filename = $a[$idx_file]['name']; 30 /* 31 *Removed by Bug #546 32 *include("class.imap_attachment.inc.php"); 33 *$imap_attachment = new imap_attachment(); 34 *$a = $imap_attachment->download_attachment($mbox_stream, $msg_number); 35 *$filename = $a[$idx_file]['name']; 36 */ 37 $filename = $newfilename; 32 38 } 33 39 else -
trunk/expressoMail1_2/inc/hook_settings.inc.php
r1002 r1005 67 67 create_check_box(lang('Use shortcuts?'),'use_shotcuts',''); 68 68 create_check_box(lang('Auto save draft'),'auto_save_draft',''); 69 $default = array( 70 '65536' => lang('unlimited'), 71 '640' => '640', 72 '768' => '768', 73 '800' => '800', 74 '1024' => '1024', 75 '1080' => '1080' 76 ); 77 78 create_select_box(lang('What is the maximum size of embedded images')."?",'image_size',$default,''); 69 79 70 80 $default = array(
Note: See TracChangeset
for help on using the changeset viewer.