Changeset 9090 for temp/trunk/data/class


Ignore:
Timestamp:
2006/11/27 10:54:15 (20 years ago)
Author:
kakinaka
Message:

blank

File:
1 edited

Legend:

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

    r5934 r9090  
    5151        } 
    5252    } 
     53 
     54    // ³ÈÂçΨ¤ò»ØÄꤷ¤Æ²èÁüÊݸ 
     55    function saveResizeImage($file, $zip_scale = 1) { 
     56        // ¥Ç¥£¥ì¥¯¥È¥ê¼èÆÀ 
     57        $dir = dirname($file); 
     58         
     59        // ¸µ²èÁü¥µ¥¤¥º¤ò¼èÆÀ 
     60        list($src_w, $src_h) = getimagesize($file); 
     61     
     62        // °µ½ÌΨ»ØÄê 
     63        $zip_width = $src_w * $zip_scale; 
     64        $zip_height = $src_h * $zip_scale; 
     65         
     66        // °µ½ÌÀè²èÁü 
     67        $dst_im = imagecreatetruecolor($zip_width, $zip_height);     
     68        imagecopyresampled($dst_im, $file, 0, 0, 0,0, $zip_width, $zip_height, $src_w, $src_h); 
     69 
     70        // ²èÁü½ÐÎÏ 
     71//      header("Content-Type: image/gif"); 
     72//      ImageGIF($dst_im); 
     73//      ImageDestroy($dst_im); 
     74         
     75        // °ì°Õ¤ÊID¤ò¼èÆÀ¤¹¤ë¡£ 
     76        $uniqname = date("mdHi") . "_" . uniqid(""); 
     77        $filename = $uniqname . ".gif"; 
     78        $path = $dir . $filename; 
     79        if(is_dir($dir)) { 
     80            ImageGIF($dst_im, $path); 
     81            return $path; 
     82        } 
     83         
     84        print("²èÁü¤ÎÊݸ¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£"); 
     85        return ""; 
     86    } 
    5387} 
    5488?> 
Note: See TracChangeset for help on using the changeset viewer.