Ignore:
Timestamp:
2010/03/11 10:35:11 (14 years ago)
Author:
kajiwara
Message:

正式版にナイトリービルド版をマージしてみるテスト

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tmp/version-2_5-test/data/class/SC_Image.php

    r18562 r18609  
    2929    function SC_Image($tmp_dir) { 
    3030        // ヘッダファイル読込 
    31         if(!ereg("/$", $tmp_dir)) { 
     31        if (!ereg("/$", $tmp_dir)) { 
    3232            $this->tmp_dir = $tmp_dir . "/"; 
    3333        } else { 
     
    5252        $from_path = $this->tmp_dir.$filename; 
    5353        $to_path = $save_dir."/".$filename; 
    54         if(file_exists($from_path) && file_exists($save_dir)) { 
    55             if(copy($from_path , $to_path)) { 
     54        if (file_exists($from_path) && file_exists($save_dir)) { 
     55            if (copy($from_path , $to_path)) { 
    5656                unlink($from_path); 
    5757            } 
     
    6363    //---- 指定ファイルを削除 
    6464    function deleteImage($filename, $dir) { 
    65         if(file_exists($dir."/".$filename)) { 
     65        if (file_exists($dir."/".$filename)) { 
    6666            unlink($dir."/".$filename); 
    6767        } 
     
    8888        $PreWord = $head; 
    8989 
    90             //拡張子取得 
    91             if (!$ext) { 
    92                 $array_ext = explode(".", $FromImgPath); 
    93                 $ext = $array_ext[count($array_ext) - 1]; 
    94             } 
     90        //拡張子取得 
     91        if (!$ext) { 
     92            $array_ext = explode(".", $FromImgPath); 
     93            $ext = $array_ext[count($array_ext) - 1]; 
     94        } 
    9595 
    9696        $MW = $ThmMaxWidth; 
    97         if($tmpMW) $MW = $tmpMW; // $MWに最大横幅セット 
     97        if ($tmpMW) $MW = $tmpMW; // $MWに最大横幅セット 
    9898 
    9999        $MH = $ThmMaxHeight; 
    100         if($tmpMH) $MH = $tmpMH; // $MHに最大縦幅セット 
    101  
    102         if(empty($FromImgPath) || empty($ToImgPath)){ 
     100        if ($tmpMH) $MH = $tmpMH; // $MHに最大縦幅セット 
     101 
     102        if (empty($FromImgPath) || empty($ToImgPath)){ 
    103103            return array(0,"出力元画像パス、または出力先フォルダが指定されていません。"); 
    104104        } 
    105105 
    106         if(!file_exists($FromImgPath)){ 
     106        if (!file_exists($FromImgPath)){ 
    107107            return array(0,"出力元画像が見つかりません。"); 
    108108        } 
     
    111111        $re_size = $size; 
    112112 
    113         if(!$size[2] || $size[2] > 3){ // 画像の種類が不明 or swf 
     113        if (!$size[2] || $size[2] > 3){ // 画像の種類が不明 or swf 
    114114            return array(0,"画像形式がサポートされていません。"); 
    115115        } 
     
    118118        $tmp_w = $size[0] / $MW; 
    119119 
    120         if($MH != 0){ 
     120        if ($MH != 0){ 
    121121            $tmp_h = $size[1] / $MH; 
    122122        } 
    123123 
    124         if($tmp_w > 1 || $tmp_h > 1){ 
    125             if($MH == 0){ 
    126                 if($tmp_w > 1){ 
     124        if ($tmp_w > 1 || $tmp_h > 1){ 
     125            if ($MH == 0){ 
     126                if ($tmp_w > 1){ 
    127127                    $re_size[0] = $MW; 
    128128                    $re_size[1] = $size[1] * $MW / $size[0]; 
    129129                } 
    130130            } else { 
    131                 if($tmp_w > $tmp_h){ 
     131                if ($tmp_w > $tmp_h){ 
    132132                    $re_size[0] = $MW; 
    133133                    $re_size[1] = $size[1] * $MW / $size[0]; 
     
    148148        switch($size[2]) { 
    149149        case "1": //gif形式 
    150             if($tmp_w <= 1 && $tmp_h <= 1){ 
    151                 if ( $newFileName ) { 
     150            if ($tmp_w <= 1 && $tmp_h <= 1){ 
     151                if ($newFileName) { 
    152152                    $ToFile = $newFileName; 
    153153                } elseif  ($ext) { 
     
    156156                    $ToFile .= ".gif"; 
    157157                } 
    158                 if(!@copy($FromImgPath , $ToImgPath.$ToFile)) { // エラー処理 
     158                if (!@copy($FromImgPath , $ToImgPath.$ToFile)) { // エラー処理 
    159159                    return array(0,"ファイルのコピーに失敗しました。"); 
    160160                } 
     
    169169            ImageRectangle ($ImgNew,0,0,($re_size[0]-1),($re_size[1]-1),    $black); 
    170170 
    171             if ( $newFileName ) { 
     171            if ($newFileName) { 
    172172                $ToFile = $newFileName; 
    173             } elseif($ext) { 
     173            } elseif ($ext) { 
    174174                $ToFile .= "." . $ext; 
    175175            } else { 
     
    178178            $TmpPath = $ToImgPath.$ToFile; 
    179179            @Imagepng($ImgNew,$TmpPath); 
    180             if(!@file_exists($TmpPath)){ // 画像が作成されていない場合 
     180            if (!@file_exists($TmpPath)){ // 画像が作成されていない場合 
    181181                return array(0,"画像の出力に失敗しました。"); 
    182182            } 
     
    188188            //ImageCopyResized( $ImgNew,$ImgDefault, 0, 0, 0, 0,$re_size[0], $re_size[1],$size[0], $size[1]); 
    189189 
    190             if($re_size[0] != $size[0] || $re_size[0] != $size[0]) { 
     190            if ($re_size[0] != $size[0] || $re_size[0] != $size[0]) { 
    191191                ImageCopyResampled( $ImgNew,$ImgDefault, 0, 0, 0, 0,$re_size[0], $re_size[1],$size[0], $size[1]); 
    192192            } 
     
    197197 
    198198 
    199             if ( $newFileName ) { 
     199            if ($newFileName) { 
    200200                $ToFile = $newFileName; 
    201             } elseif($ext) { 
     201            } elseif ($ext) { 
    202202                $ToFile .= "." . $ext; 
    203203            } else { 
     
    206206            $TmpPath = $ToImgPath.$ToFile; 
    207207            @ImageJpeg($ImgNew,$TmpPath); 
    208             if(!@file_exists($TmpPath)){ // 画像が作成されていない場合 
     208            if (!@file_exists($TmpPath)){ // 画像が作成されていない場合 
    209209                return array(0,"画像の出力に失敗しました。<br>${ImgNew}<br>${TmpPath}"); 
    210210            } 
     
    217217            ImageCopyResampled($ImgNew, $ImgDefault, 0, 0, 0, 0,$re_size[0], $re_size[1],$size[0], $size[1]); 
    218218 
    219             if ( $newFileName ) { 
     219            if ($newFileName) { 
    220220                $ToFile = $newFileName; 
    221221            } elseif ($ext) { 
     
    226226            $TmpPath = $ToImgPath.$ToFile; 
    227227            @ImagePNG($ImgNew,$TmpPath ); 
    228             if(!@file_exists($TmpPath)){ // 画像が作成されていない場合 
     228            if (!@file_exists($TmpPath)){ // 画像が作成されていない場合 
    229229                return array(0,"画像の出力に失敗しました。"); 
    230230            } 
Note: See TracChangeset for help on using the changeset viewer.