Changeset 16273


Ignore:
Timestamp:
2007/10/05 21:09:09 (16 years ago)
Author:
naka
Message:

ファイルが存在しないときのgetimagesizeのエラー抑制

Location:
branches/feature-module-update/data/class
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/data/class/helper/SC_Helper_DB.php

    r15630 r16273  
    335335 
    336336                // 画像サイズ 
    337                 list($image_width, $image_height) = getimagesize(IMAGE_SAVE_DIR . basename($objPage->arrProductsClass[$cnt]["main_image"])); 
     337                $main_image_path = IMAGE_SAVE_DIR . basename($objPage->arrProductsClass[$cnt]["main_image"]); 
     338                if(file_exists($main_image_path)) { 
     339                    list($image_width, $image_height) = getimagesize($main_image_path); 
     340                } else { 
     341                    $image_width = 0; 
     342                    $image_height = 0; 
     343                } 
     344 
    338345                $objPage->arrProductsClass[$cnt]["tpl_image_width"] = $image_width + 60; 
    339                 $objPage->arrProductsClass[$cnt]["tpl_image_height"] = $image_height + 80; 
    340  
     346                $objPage->arrProductsClass[$cnt]["tpl_image_height"] = $image_height + 80; 
    341347                // 価格の登録 
    342348                if ($arrData['price02'] != "") { 
  • branches/feature-module-update/data/class/pages/products/LC_Page_Products_DetailImage.php

    r15532 r16273  
    5959        $col = "name, $image_key"; 
    6060        $arrRet = $objQuery->select($col, "dtb_products", "product_id = ?", array($_GET['product_id'])); 
    61  
    62         list($width, $height) = getimagesize(IMAGE_SAVE_DIR . $arrRet[0][$image_key]); 
    63         $this->tpl_width = $width; 
    64         $this->tpl_height = $height; 
    65  
     61        $image_path = IMAGE_SAVE_DIR . $arrRet[0][$image_key]; 
     62         
     63        if(file_exists($image_path)) { 
     64            list($width, $height) = getimagesize($image_path); 
     65        } else { 
     66            $width = 0; 
     67            $height = 0; 
     68        } 
     69         
     70        $this->tpl_width = $width; 
     71        $this->tpl_height = $height; 
    6672        $this->tpl_table_width = $this->tpl_width + 20; 
    6773        $this->tpl_table_height = $this->tpl_height + 20; 
Note: See TracChangeset for help on using the changeset viewer.