썸네일 문의 드립니다.
본문
올린 이미지가 설정한 썸네일 사이즈 보다 작으면 흰여백이 나와요. 아래 그림처럼요
thumbnail.lib.php 파일에
$is_crop=true, 이걸 한들 false 이걸 한들 변동 사항은 없고...
작은 이미지라도 꽉 차고 맞게 나오도록 하려면 어떻게 해야 할까요?
<?php
if ( !defined( '_GNUBOARD_' ) )exit; //개별 페이지 접근 불가
$img_w = $wset['thumb_w'] = ( isset( $wset[ 'thumb_w' ] ) && $wset[ 'thumb_w' ] > 0 ) ? $wset[ 'thumb_w' ] : 803;
$img_h = $wset['thumb_h'] = ( isset( $wset[ 'thumb_h' ] ) && $wset[ 'thumb_h' ] > 0 ) ? $wset[ 'thumb_h' ] : 380;
$imgs_w = $wset[ 'thumb_w' ] = ( isset( $wset[ 'thumb_w' ] ) && $wset[ 'thumb_w' ] > 0 ) ? $wset[ 'thumb_w' ] : 246;
$imgs_h = $wset[ 'thumb_h' ] = ( isset( $wset[ 'thumb_h' ] ) && $wset[ 'thumb_h' ] > 0 ) ? $wset[ 'thumb_h' ] : 120;
}
?>
<div class="m">
<ul class="pgwSlider">
<?php
for ( $i = 0; $i < $list_cnt; $i++ ) {
//print_r2($list[$i]);
$thumbs = get_list_thumbnail( $list[ $i ][ 'bo_table' ], $list[ $i ][ 'wr_id' ], $img_w, $img_h, false, true );
$thumbs2 = get_list_thumbnail( $list[ $i ][ 'bo_table' ], $list[ $i ][ 'wr_id' ], $imgs_w, $imgs_h, false, true );
if ( $thumbs[ 'src' ] ) {
$img = $thumbs[ 'src' ];
$imgs = $thumbs2[ 'ori' ];
}
?>
<li><a href="<?php echo $list[$i]['href'];?>"<?php echo $is_modal_js;?><?php echo $target;?>>
<img src="<?php echo $imgs; ?>" alt="<?php echo $list[$i]['subject']; ?>" data-large-src="<?php echo $img;?>" data-description="<?php echo mb_strimwidth(strip_tags ($list[$i]['wr_content']), '0', '130', '', 'utf-8');?>" />
</a>
</li>
<?php
}
?>
</ul>
</div>
<?php if(!$list_cnt) { ?>
<div class="post-none">글이 없습니다.</div>
<?php } ?>
답변 1
/lib/thumbnail.lib.php 파일
344번째 줄에 보면
} else if($size[0] < $thumb_width || $size[1] < $thumb_height) {
$is_large = false;
}
이렇게 돼 있는데
// $is_large = false;
이부분을 위와 같이 주석처리해 주시면 됩니다.
답변을 작성하시기 전에 로그인 해주세요.