이미지 출력 (썸네일) 질문 하나 더 드립니다
본문
관리자에서 이미지(소) 이미지(중) 부분을 높이를0으로 맞추면 (가로 크기가 고정되어) 상품의 세로 길이가 다 달라지는데요.
저는 폭 0 세로 175 이렇게 세로를 고정 시키려고 합니다
shop.lib.php 이 부분에서 수정해야 된다는 건 알았는데요
어떻게 수정을 해야 나오는지를 모르겠네요. 어떻게 수정을 해줘야 될까요.
shop.lib.php
// 상품 이미지를 얻는다
function get_it_image($it_id, $width, $height=0, $anchor=false, $img_id='', $img_alt='')
{
global $g5;
if(!$it_id || !$height)
return '';
$sql = " select it_id, it_img1, it_img2, it_img3, it_img4, it_img5, it_img6, it_img7, it_img8, it_img9, it_img10 from {$g5['g5_shop_item_table']} where it_id = '$it_id' ";
$row = sql_fetch($sql);
if(!$row['it_id'])
return '';
for($i=1;$i<=10; $i++) {
$file = G5_DATA_PATH.'/item/'.$row['it_img'.$i];
if(is_file($file) && $row['it_img'.$i]) {
$size = @getimagesize($file);
if($size[2] < 1 || $size[2] > 3)
continue;
$filename = basename($file);
$filepath = dirname($file);
$img_width = $size[0];
$img_height = $size[1];
break;
}
}
if($img_width && !$height) {
$height = round(($width * $img_height) / $img_width);
}
답변 2
for($i=1;$i<=10; $i++) {
$file = G5_DATA_PATH.'/item/'.$row['it_img'.$i];
if(is_file($file) && $row['it_img'.$i]) {
$size = @getimagesize($file);
if($size[2] < 1 || $size[2] > 3)
continue;
$filename = basename($file);
$filepath = dirname($file);
//$img_width = $size[0];
//$img_height = $size[1];
$img_width= 0;
$img_height=175;
break;
}
}
영카트5에 썸네일 크기 지정하는 기능이 있던가요?
어디입니까?