Changeset 9201


Ignore:
Timestamp:
2006/11/27 19:38:52 (20 years ago)
Author:
kakinaka
Message:

blank

Location:
temp/trunk
Files:
2 edited

Legend:

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

    r9196 r9201  
    5353 
    5454    // ³ÈÂçΨ¤ò»ØÄꤷ¤Æ²èÁüÊݸ 
    55     function saveResizeImage($file, $to_w = 1, $to_h = 1, $header = false) { 
     55    function saveResizeImage($file, $to_w = 0, $to_h = 0, $header = false) { 
    5656        // ¥Ç¥£¥ì¥¯¥È¥ê¼èÆÀ 
    5757        $dir = dirname($file); 
     
    6060        list($from_w, $from_h) = getimagesize($file); 
    6161         
    62         // Éý¤Î½Ì¾®Î¨ 
    63         ($to_w < $from_w) ? $wscale = $to_w / $from_w : $wscale = 1; 
    64         // ¹â¤µ¤Î½Ì¾®Î¨ 
    65         ($to_h < $from_h) ? $hscale = $to_h / $from_h : $hscale = 1; 
    66         // ½Ì¾®Î¨¤Ï¾®¤µ¤¤¤Û¤¦¤Ë¤¢¤ï¤»¤ë 
    67         ($wscale < $hscale) ? $scale = $wscale : $scale = $hscale; 
     62        if($to_w == 0 or $to_h == 0){ 
     63            $scale = 1; 
     64        }else{ 
     65            // Éý¤Î½Ì¾®Î¨ 
     66            ($to_w < $from_w) ? $wscale = $to_w / $from_w : $wscale = 1; 
     67            // ¹â¤µ¤Î½Ì¾®Î¨ 
     68            ($to_h < $from_h) ? $hscale = $to_h / $from_h : $hscale = 1; 
     69            // ½Ì¾®Î¨¤Ï¾®¤µ¤¤¤Û¤¦¤Ë¤¢¤ï¤»¤ë 
     70            ($wscale < $hscale) ? $scale = $wscale : $scale = $hscale; 
     71        } 
    6872 
    6973        // °µ½ÌΨ»ØÄê 
  • temp/trunk/html/resize_image.php

    r9200 r9201  
    1212    header("Content-Type: image/gif"); 
    1313    $image = ImageCreateFromGIF(NO_IMAGE_URL); 
    14 /*  imagecopyresampled($dst_im, $src_im, 0, 0, 0,0, $zip_width, $zip_height, $from_w, $from_h); 
     14    imagecopyresampled($dst_im, $src_im, 0, 0, 0,0, $zip_width, $zip_height, $from_w, $from_h); 
    1515    Imagegif($image); 
    1616    ImageDestroy($image); 
    17     */ 
    1817    ImageGIF($image); 
    1918    ImageDestroy($image); 
Note: See TracChangeset for help on using the changeset viewer.