썸네일 크기 문제...
본문
smarteditor2 사진 첨부 기능으로 사진을 올리면 리스트에 이미지가 나오게 하고싶은데
가로 길이(넓이)보다 세로 길이(높이)가 큰 이미지를 올리면 아래처럼 양쪽으로 빈 여백이 보입니다.
관리자 페이지에서 모바일 갤러리 폭 * 높이와 무관하게 이미지 크기가 width:100%;height:auto;
해서 여백이 없이 하고싶은데 어찌 해야 할까요?
아래 소스로 해서 첨부파일로해서 이미지를 올리면 어떤 이미지든 넓이 100%로해서 높이 자동으로 잘 보입니다.
css에
.gall_li {float:left;width:100%;padding:0}
.gall_li .gall_img img{width:100%;height:auto;padding:0 0 10px 0;}
<a href="<?php echo $list[$i]['href'] ?>" class="gall_img">
<?php
$v_img_count = count($list[$i]['file']);
if($v_img_count) {
if ($list[$i]['file'][0]['view']) {
echo strip_tags(get_view_thumbnail($list[$i]['file'][0]['view']), '<img>');
}
}
?>
</a>
그런데 제가 에디터 이미지도 목록에서 나오게 할려고 소스를 수정했더니
첨부파일이든 에디터 이미지든 관리자 페이지에서 설정하고 넓이와 높이로 나오는데
세로 이미지가 크면 여백이 생깁니다.
css에
.gall_li {float:left;width:100%;padding:0}
.gall_li .gall_img img{width:100%;height:auto;padding:0 0 10px 0;}
<a href="<?php echo $list[$i]['href'] ?>" class="gall_img">
<?php
$v_img_count = count($list[$i]['file']);
if($v_img_count) {
if ($list[$i]['file'][0]['view']) {
echo strip_tags(get_view_thumbnail($list[$i]['file'][0]['view']), '<img>');
}
{
$thumb = get_list_thumbnail($board['bo_table'], $list[$i]['wr_id'], $board['bo_mobile_gallery_width'], $board['bo_mobile_gallery_height']);
if($thumb['src']) {
$img_content = '<img src="'.$thumb['src'].'" alt="'.$thumb['alt'].'" width="'.$board['bo_mobile_gallery_width'].'" height="'.$board['bo_mobile_gallery_height'].'">';
} else {
$img_content = '';
}
echo $img_content;
}
}
?>
</a>
위에 코드를 어떻게 수정해야지 첨부파일 이미지든 에디터 이미지든
width:100%;height:auto; 로 해서 게시판 list.skin.php에서 보일까요?
!-->!-->답변 1
세로가 긴 이미지면 crop 문제 아닌가요?
lib/thumbnail.lib.php 파일에서 $is_crop=true 로 변경해보세요.
수정 후 관리자페이지 > 환경설정 > 썸네일파일 일괄삭제
// 게시글리스트 썸네일 생성
function get_list_thumbnail($bo_table, $wr_id, $thumb_width, $thumb_height, $is_create=false, $is_crop=true, $crop_mode='center', $is_sharpen=false, $um_value='80/0.5/3')
썸네일 이미지 출력할 때 여백 없이 사용하기
http://gnustudy.com/bbs/board.php?bo_table=gnu_tip&wr_id=156