Changeset 9181 for temp/trunk
- Timestamp:
- 2006/11/27 18:47:31 (20 years ago)
- Location:
- temp/trunk
- Files:
-
- 2 edited
-
data/class/SC_Image.php (modified) (5 diffs)
-
html/test/kakinaka/resize_image.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
temp/trunk/data/class/SC_Image.php
r9128 r9181 53 53 54 54 // ³ÈÂçΨ¤ò»ØÄꤷ¤Æ²èÁüÊݸ 55 function saveResizeImage($file, $zip_scale = 1 ) {55 function saveResizeImage($file, $zip_scale = 1, $header = false) { 56 56 // ¥Ç¥£¥ì¥¯¥È¥ê¼èÆÀ 57 57 $dir = dirname($file); … … 86 86 $dst_im = imagecreatetruecolor($zip_width, $zip_height); 87 87 imagecopyresampled($dst_im, $src_im, 0, 0, 0,0, $zip_width, $zip_height, $src_w, $src_h); 88 89 // ²èÁü½ÐÎÏ 90 if($header) header("Content-Type: image/jpeg"); 91 88 92 ImageJPEG($dst_im, $path); 89 93 break; … … 95 99 $dst_im = imagecreatetruecolor($zip_width, $zip_height); 96 100 imagecopyresampled($dst_im, $src_im, 0, 0, 0,0, $zip_width, $zip_height, $src_w, $src_h); 101 102 // ²èÁü½ÐÎÏ 103 if($header) header("Content-Type: image/gif"); 104 97 105 ImageGIF($dst_im, $path); 98 106 break; … … 104 112 $dst_im = imagecreatetruecolor($zip_width, $zip_height); 105 113 imagecopyresampled($dst_im, $src_im, 0, 0, 0,0, $zip_width, $zip_height, $src_w, $src_h); 114 115 // ²èÁü½ÐÎÏ 116 if($header) header("Content-Type: image/png"); 117 106 118 ImagePNG($dst_im, $path); 107 119 break; … … 113 125 ImageDestroy($src_im); 114 126 ImageDestroy($dst_im); 115 return $path; 127 128 if(!$header){ 129 return $path; 130 }else{ 131 return ""; 132 } 116 133 } 117 134 -
temp/trunk/html/test/kakinaka/resize_image.php
r9098 r9181 10 10 11 11 sfprintr(pathinfo($file)); 12 $path = $objImage->saveResizeImage($file, 0.5 );12 $path = $objImage->saveResizeImage($file, 0.5, true); 13 13 14 sfprintr($path);14 //sfprintr($path); 15 15 16 16 ?>
Note: See TracChangeset
for help on using the changeset viewer.
