Changeset 9095 for temp/trunk


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

blank

File:
1 edited

Legend:

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

    r9092 r9095  
    7171        imagecopyresampled($dst_im, $src_im, 0, 0, 0,0, $zip_width, $zip_height, $src_w, $src_h); 
    7272 
    73         // ²èÁü½ÐÎÏ 
    74 //      header("Content-Type: image/gif"); 
    75 //      ImageGIF($dst_im); 
    76 //      ImageDestroy($dst_im); 
    77          
    7873        // °ì°Õ¤ÊID¤ò¼èÆÀ¤¹¤ë¡£ 
    7974        $uniqname = date("mdHi") . "_" . uniqid(""); 
    80         $filename = $uniqname . ".gif"; 
     75 
     76        // ¥Õ¥¡¥¤¥ë¤Î³ÈÄ¥»Ò¼èÆÀ      
     77        $arrFileInfo = pathinfo($file); 
     78        $extension = $arrFileInfo["extension"]; 
     79         
     80        // ¥Õ¥¡¥¤¥ë̾¡¢ÊݸÀèÀßÄê 
     81        $filename = $uniqname . $extension; 
    8182        $path = $dir . "/" . $filename; 
     83         
     84        // ¥Õ¥¡¥¤¥ë¤Î³ÈÄ¥»Ò¤Ë¤è¤Ã¤Æ½èÍý¤òʬ¤±¤ë 
    8285        if(is_dir($dir)) { 
    83             ImageGIF($dst_im, $path); 
     86            switch ($extension) { 
     87                case "jpg": 
     88                case "jpeg": 
     89                    ImageJPEG($dst_im, $path); 
     90                    break; 
     91                case "gif": 
     92                    ImageGIF($dst_im, $path); 
     93                    break; 
     94                case "png": 
     95                    ImagePNG($dst_im, $path); 
     96                    break; 
     97                case "default": 
     98                    print("³ÈÄ¥»Ò¤¬ÉÔÀµ¤Ç¤¹¡£"); 
     99                    return ""; 
     100            } 
    84101            return $path; 
    85102        } 
Note: See TracChangeset for help on using the changeset viewer.