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

· 2008-09-29 (월) 13:03:42 · 875 · 1
1.jpg
오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.

오류 주소 :

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


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


======================================================
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}%'> </td>";
?>

첨부파일

1.jpg (65.5 KB)
0회 2008-09-29 13:12
|

댓글 1개

2008-09-29 (월) 18:17:59
imagecopyresampled($dst, $src, 0, 0, 0, 0, $board[bo_1], $height, $size[0], $size[1]);
board[bo_1]에 이미지 가로 크기를 넣으셨을 겁니다.
$height에 세로 크기에 해당하는 값을 넣으세요.
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

66,531건

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

+
제목 글쓴이 날짜 조회
08-09-29 조회 828
08-09-29 조회 832
08-09-29 조회 854
08-09-29 조회 876
08-09-29 조회 818
08-09-29 조회 902
08-09-29 조회 913
08-09-29 조회 991
08-09-29 조회 880
08-09-29 조회 1,314
08-09-29 조회 1,016
08-09-29 조회 837
08-09-29 조회 838
08-09-29 조회 1,030
08-09-29 조회 802
08-09-29 조회 833
08-09-28 조회 842
08-09-28 조회 1,297
08-09-28 조회 846
08-09-28 조회 903