갤러리 가로세로 크기 문제점.... > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

갤러리 가로세로 크기 문제점.... 정보

갤러리 가로세로 크기 문제점....

본문

오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.

오류 주소 :

섬네일크기를 정해놨을때 그누보드 갤러리는 이미지를 불러올때, 한쪽 이미지 크기가 안맞으면
그쪽 이미지가 잘려서 공백으로 보이잖아요? <첨부사진처럼>
 

이미지가 그냥 가로세로에 맞게 하려면 어떻게 해야 되나요.
저기에 대해서 검색해도 없길래 질문드려요.


======================================================
list.skin.php 일부입니다.

<?
for ($i=0; $i<count($list); $i++)
{
    if ($i && $i%$mod==0)
        echo "</tr><tr>";

    $img = "<img src='$board_skin_path/img/no_img.gif' border=0 width='$board[bo_1]' title='이미지 없음'>";
    $thumb = $thumb_path.'/'.$list[$i][wr_id];
    if (!file_exists($thumb))
    {
        $file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
        if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file))
        {
            $size = getimagesize($file);
            if ($size[2] == 1)
                $src = imagecreatefromgif($file);
            else if ($size[2] == 2)
                $src = imagecreatefromjpeg($file);
            else if ($size[2] == 3)
                $src = imagecreatefrompng($file);
            else
                continue;

            $rate = $board[bo_1] / $size[0];
            $height = (int)($size[1] * $rate);

            if ($height < $board[bo_2])
                $dst = imagecreatetruecolor($board[bo_1], $height);
            else
                $dst = imagecreatetruecolor($board[bo_1], $board[bo_2]);
            imagecopyresampled($dst, $src, 0, 0, 0, 0, $board[bo_1], $height, $size[0], $size[1]);
            imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $board[bo_9]);
            chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
        }
    }

    if (file_exists($thumb))
        $img = "<img src='$thumb' border=0>";

    $photo_view = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
    if (preg_match("/\.(jp[e]?g|gif|png)$/i", $photo_view) && file_exists($photo_view))

    $style = "";
    if ($list[$i][icon_new])
        $style = ""; // 읽지 않은 글??  style='font-weight:bold;'  추가
    $subject = "<span $style>". $list[$i][subject] ."</span>";

    $comment_cnt = "";
    if ($list[$i][comment_cnt])
        $comment_cnt = " <a href=\"{$list[$i][comment_href]}\"><span class='L_comment_cnt'>{$list[$i][comment_cnt]}</span></a>";

    echo "<td width='{$td_width}%' valign=top style='word-break:break-all;'>";
    echo "<table cellpadding=0 cellspacing=0 border=0>";
    echo "<tr><td align=center width='{$board[bo_1]}' height='{$board[bo_2]}' style='width:{$board[bo_1]}px; height:{$board[bo_2]}px; border:1px solid #CCCCCC; padding:3px'><div style='width:{$board[bo_1]}px; height:{$board[bo_2]}px; position: relative; overflow:hidden;' align=center><IMG src='{$thumb}' onClick=\"view_photo('{$photo_view}');\" style=\"CURSOR: hand;\"></div></td></tr>";
    echo "<tr><td width={$board[bo_1]} height=22 align=center><a href='{$list[$i][href]}'><span class=L_subject>$subject</span></a>{$comment_cnt}</td></tr>";
    if ($is_category) echo "<tr><td align=center><a href='{$list[$i][ca_name_href]}'><span class=L_category>{$list[$i][ca_name]}</span></a></td></tr>";
    if ($is_checkbox) echo "<tr><td align=center><input type=checkbox name=chk_wr_id[] value='{$list[$i][wr_id]}'></td></tr>";
    echo "<tr><td height=5></td></tr>";
    echo "</table></td>\n";
}

// 나머지 td
$cnt = $i%$mod;
if ($cnt)
    for ($i=$cnt; $i<$mod; $i++)
        echo "<td width='{$td_width}%'>&nbsp;</td>";
?>

댓글 전체

imagecopyresampled($dst, $src, 0, 0, 0, 0, $board[bo_1], $height, $size[0], $size[1]);
board[bo_1]에 이미지 가로 크기를 넣으셨을 겁니다.
$height에 세로 크기에 해당하는 값을 넣으세요.
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT