Changeset 9201 for temp/trunk/data


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

blank

File:
1 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        // °µ½ÌΨ»ØÄê 
Note: See TracChangeset for help on using the changeset viewer.