미채택 완료

게시판에 올린 이미지가 외부 출력될 때, 썸네일이 아닌 원본이미지로 보이게 하고 싶습니다.

2016-05-25 (수) 13:35:36 3,246

현재 운영중인 사이트에서 게시판에 첨부파일로 이미지를 올리면 메인 화면에 그 이미지가 출력되도록 되어있는 상태입니다.

그런데 썸네일로 변환되어 올라가서 그런지 화질이 너무 흐릿하고 뿌옇게 나옵니다.

이미지를 원본 그대로 보여지게 하거나 썸네일로 변환되어도 화질이 뚜렷하게 나오게끔 하고 싶습니다.

http://www.moa-ba.com -> 해당사이트 중간에 이미지 6개가 있는 'mid_banner'영역입니다.

이 코드를 보여 드리는 것이 맞는지는 모르겠지만

아래 코드가 mid_banner에 적용중인 latest.skin.php 라는 문서입니다.

Copy
<?if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 include_once("./gnu/lib/thumb.lib.php");//$cols  = 1; //  이미지 가로갯수 //  이미지 세로 갯수는 메인에서 지정(총 이미지 수)//$image_h  = 1; // 이미지 상하 간격$col_width = (int)(99 / $cols);$data_path = "./gnu/data/file/$board_id";$thumb_path = $data_path;?><div class="slider-wrapper theme-default"><div id="slider" class="nivoSlider"><?for ($i=0; $i<count($list); $i++) { $image = $list[$i][file][0][file]; //원본$img=$data_path. "/".$image;  //썸네일이 없을경우 원본출력$thumb = $thumb_path. "/". $list[$i][wr_10];   if ( file_exists($thumb) ) $img = $thumb;      //$style = "font-family:돋움; font-size:9pt; color:#636363;";    //if ($list[$i][icon_new])    //$style = "style='font-family:돋움; font-size:9pt; color:#006F00;' "; //$subject = $list[$i][subject]; //제목 글자수 자르기 //$bg = "";  //새글?     //if ($list[$i][icon_new])      //  $bg="la_top_2.gif";     //else       // $bg="la_top_1.gif";     //echo $list[$i][icon_reply] . " ";        echo "<a href='{$list[$i]['href']}'><img src='$img' border='0' width='1024px' height='325px'></a>";  //echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'>";  //echo "  <tr><td valign='top' align='center' width=80><a href='{$list[$i]['href']}'><img src='$img' width='75' height='60' border='0'></a></td>";  //echo "  <td height='21' valign=top style='padding-left:5px;'><table width='100%' cellpadding='0' cellspacing='0' border='0'><tr><td><a href='{$list[$i]['href']}' style='color:#666666;'><b>{$subject}</b></a></td></tr><tr><td><a href='{$list[$i]['href']}' style='color:#666666;'>".cut_str(strip_tags($list[$i][wr_content]),50)."</a></td></tr></table></td></tr></table>";} ?></div></div><?$cnt = ($i%$cols); for ($k=$cnt; $k<$cols && $cnt; $k++) {     echo "<td width=$col_width%>&nbsp;</td>"; } if (count($list) == 0) { echo "<td height=80 align=center>게시물이 없습니다.</td>"; }
 

답변 2개 / 댓글 1개

1. jpg 파일이라면 환경설정에서 jpg 썸네일 품질을 올려보세요.

2. 혹시 출력되는 썸네일 이미지위 크기보다 실제 표현되는 크기가 더 커서 원본이 늘어나는 문제는 아닌지요?

해당 소스에 코멘트처리 되어있는 부분에 원본출력이라고 나와있네요

$img=$data_path. "/".$image;  

//썸네일이 없을경우 원본출력이부분을 출력하면 될꺼같은데요

if ( file_exists($thumb) )  

$img = $thumb;

여기 if문에선 썸네일 파일이있다면

$img를 $thumb으로 출력시키는데

$img = $thumb;를 $img=$data_path. "/".$image; 로 바꾸시면

원본이 나올꺼같은데요?<

답변에 대한 댓글 1개

해봤는데 엑박이 뜨면서 메인쪽에 아예 출력이 안되네요ㅜ

답변을 작성하려면 로그인이 필요합니다.