- Timestamp:
- 2006/11/28 11:05:08 (20 years ago)
- Location:
- temp/trunk
- Files:
-
- 3 edited
-
data/class/SC_Image.php (modified) (1 diff)
-
data/lib/gdthumb.php (modified) (6 diffs)
-
html/resize_image.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
temp/trunk/data/class/SC_Image.php
r9267 r9283 81 81 // °ì°Õ¤ÊID¤ò¼èÆÀ¤¹¤ë¡£ 82 82 $uniqname = date("mdHi") . "_" . uniqid(""); 83 83 84 84 // ¥Õ¥¡¥¤¥ë̾¡¢ÊݸÀèÀßÄê 85 85 $filename = $uniqname . "." . $extension; -
temp/trunk/data/lib/gdthumb.php
r9276 r9283 72 72 * integer $height 73 73 */ 74 function Main($path, $width, $height, $dst_file ) {74 function Main($path, $width, $height, $dst_file, $header = false) { 75 75 76 76 if(!isset($path)) { … … 126 126 $dst_im = $imagecreate($re_size[0], $re_size[1]); 127 127 128 //$transparent = imagecolortransparent($src_im);129 //$colorstotal = imagecolorstotal ($src_im);128 $transparent = imagecolortransparent($src_im); 129 $colorstotal = imagecolorstotal ($src_im); 130 130 131 131 $dst_im = imagecreate($re_size[0], $re_size[1]); … … 138 138 139 139 if(function_exists("imagegif")) { 140 $dst_file = $dst_file . ".gif"; 141 imagegif($dst_im, $dst_file); 140 141 // ²èÁü½ÐÎÏ 142 if($header){ 143 header("Content-Type: image/gif"); 144 imagegif($dst_im); 145 return ""; 146 }else{ 147 $dst_file = $dst_file . ".gif"; 148 imagegif($dst_im, $dst_file); 149 } 150 142 151 imagedestroy($src_im); 143 152 imagedestroy($dst_im); 144 153 } else { 145 $dst_file = $dst_file . ".png"; 146 imagepng($dst_im, $dst_file); 154 // ²èÁü½ÐÎÏ 155 if($header){ 156 header("Content-Type: image/png"); 157 imagepng($dst_im); 158 return ""; 159 }else{ 160 $dst_file = $dst_file . ".png"; 161 imagepng($dst_im, $dst_file); 162 } 147 163 imagedestroy($src_im); 148 164 imagedestroy($dst_im); … … 159 175 imagestring($dst_im, 5, 10, 10, "GIF $size[0]x$size[1]", $red); 160 176 imageRectangle ($dst_im, 0, 0, ($re_size[0]-1), ($re_size[1]-1), $black); 161 $dst_file = $dst_file . ".png"; 162 imagepng($dst_im, $dst_file); 177 178 // ²èÁü½ÐÎÏ 179 if($header){ 180 header("Content-Type: image/png"); 181 imagepng($dst_im); 182 return ""; 183 }else{ 184 $dst_file = $dst_file . ".png"; 185 imagepng($dst_im, $dst_file); 186 } 163 187 imagedestroy($src_im); 164 188 imagedestroy($dst_im); … … 173 197 $imageresize( $dst_im, $src_im, 0, 0, 0, 0, $re_size[0], $re_size[1], $size[0], $size[1]); 174 198 175 $dst_file = $dst_file . ".jpg"; 176 imageJpeg($dst_im, $dst_file); 199 // ²èÁü½ÐÎÏ 200 if($header){ 201 header("Content-Type: image/jpeg"); 202 imageJpeg($dst_im); 203 return ""; 204 }else{ 205 $dst_file = $dst_file . ".jpg"; 206 imageJpeg($dst_im, $dst_file); 207 } 208 177 209 imagedestroy($src_im); 178 210 imagedestroy($dst_im); … … 196 228 imagecopyresized($dst_im,$src_im, 0, 0, 0, 0, $re_size[0], $re_size[1], $size[0], $size[1]); 197 229 imagetruecolortopalette($dst_im, false, imagecolorstotal($src_im)); 198 } 199 200 $dst_file = $dst_file . ".png"; 201 imagepng($dst_im, $dst_file); 230 } 231 232 // ²èÁü½ÐÎÏ 233 if($header){ 234 header("Content-Type: image/png"); 235 imagepng($dst_im); 236 return ""; 237 }else{ 238 $dst_file = $dst_file . ".png"; 239 imagepng($dst_im, $dst_file); 240 } 202 241 imagedestroy($src_im); 203 242 imagedestroy($dst_im); -
temp/trunk/html/resize_image.php
r9207 r9283 2 2 3 3 $include_dir = realpath(dirname( __FILE__)); 4 require_once($include_dir . "/../data/ class/SC_Image.php");4 require_once($include_dir . "/../data/lib/gdthumb.php"); 5 5 require_once($include_dir . "/../data/conf/conf.php"); 6 6 7 $obj Image = new SC_Image(IMAGE_TEMP_DIR);7 $objThumb = new gdthumb(); 8 8 9 9 $file = $_GET["image"]; 10 10 if(file_exists($file)){ 11 $objImage->saveResizeImage($file, $_GET["width"], $_GET["height"], true); 11 $objThumb->Main($file, $_GET["width"], $_GET["height"], "", true); 12 // $objImage->saveResizeImage($file, $_GET["width"], $_GET["height"], true); 12 13 }else{ 13 $objImage->saveResizeImage(NO_IMAGE_DIR, $_GET["width"], $_GET["height"], true); 14 // $objImage->saveResizeImage(NO_IMAGE_DIR, $_GET["width"], $_GET["height"], true); 15 $objThumb->Main(NO_IMAGE_DIR, $_GET["width"], $_GET["height"], "", true); 14 16 } 15 17
Note: See TracChangeset
for help on using the changeset viewer.
