Changeset 9181 for temp/trunk


Ignore:
Timestamp:
2006/11/27 18:47:31 (20 years ago)
Author:
kakinaka
Message:

blank

Location:
temp/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • temp/trunk/data/class/SC_Image.php

    r9128 r9181  
    5353 
    5454    // ³ÈÂçΨ¤ò»ØÄꤷ¤Æ²èÁüÊݸ 
    55     function saveResizeImage($file, $zip_scale = 1) { 
     55    function saveResizeImage($file, $zip_scale = 1, $header = false) { 
    5656        // ¥Ç¥£¥ì¥¯¥È¥ê¼èÆÀ 
    5757        $dir = dirname($file); 
     
    8686                    $dst_im = imagecreatetruecolor($zip_width, $zip_height);     
    8787                    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 
    8892                    ImageJPEG($dst_im, $path); 
    8993                    break; 
     
    9599                    $dst_im = imagecreatetruecolor($zip_width, $zip_height);     
    96100                    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                     
    97105                    ImageGIF($dst_im, $path); 
    98106                    break; 
     
    104112                    $dst_im = imagecreatetruecolor($zip_width, $zip_height);     
    105113                    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                     
    106118                    ImagePNG($dst_im, $path); 
    107119                    break; 
     
    113125            ImageDestroy($src_im); 
    114126            ImageDestroy($dst_im); 
    115             return $path; 
     127 
     128            if(!$header){ 
     129                return $path; 
     130            }else{ 
     131                return ""; 
     132            } 
    116133        } 
    117134         
  • temp/trunk/html/test/kakinaka/resize_image.php

    r9098 r9181  
    1010 
    1111sfprintr(pathinfo($file)); 
    12 $path = $objImage->saveResizeImage($file, 0.5); 
     12$path = $objImage->saveResizeImage($file, 0.5, true); 
    1313 
    14 sfprintr($path); 
     14//sfprintr($path); 
    1515 
    1616?> 
Note: See TracChangeset for help on using the changeset viewer.