Changeset 3018 for branches/2.2/expressoMail1_2/inc/show_thumbs.php
- Timestamp:
- 07/08/10 17:52:20 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/expressoMail1_2/inc/show_thumbs.php
r1040 r3018 1 1 <?php 2 if(!isset($GLOBALS['phpgw_info'])){3 $GLOBALS['phpgw_info']['flags'] = array(4 'currentapp' => 'expressoMail1_2',5 'nonavbar' => true,6 'noheader' => true7 );8 }9 require_once '../../header.inc.php';10 2 3 require_once '../../header.session.inc.php'; 11 4 $username = $_SESSION['phpgw_info']['expressomail']['user']['userid']; 12 5 $password = $_SESSION['phpgw_info']['expressomail']['user']['passwd']; … … 31 24 $image_mail = imap_fetchbody($mb, $msg_num, $msg_part, FT_UID); 32 25 $image = imap_base64($image_mail); 33 $image = imagecreatefromstring ($image); 34 35 header("Content-Type: ".$file_type); 36 header("Content-Disposition: inline"); 37 38 $pic = $image; 39 if ($pic) { 40 $width = imagesx($pic); 41 $height = imagesy($pic); 42 $twidth = 160; # width of the thumb 160 pixel 43 $theight = $twidth * $height / $width; # calculate height 44 $thumb = imagecreatetruecolor ($twidth, $theight); 26 $pic = @imagecreatefromstring ($image); 27 if($pic !== FALSE) { 28 header("Content-Type: ".$file_type); 29 header("Content-Disposition: inline"); 30 $width = imagesx($pic); 31 $height = imagesy($pic); 32 $twidth = 160; # width of the thumb 160 pixel 33 $theight = $twidth * $height / $width; # calculate height 34 $theight = $theight < 1 ? 1 : $theight; 35 $thumb = imagecreatetruecolor ($twidth, $theight); 45 36 imagecopyresized($thumb, $pic, 0, 0, 0, 0,$twidth, $theight, $width, $height); # resize image into thumb 46 37 imagejpeg($thumb,"",75); # Thumbnail as JPEG 47 38 } 48 39 ?>
Note: See TracChangeset
for help on using the changeset viewer.