갤러리 게시판 리스트에서 gif 이미지가 제대로않나오네요.. 정보
갤러리 게시판 리스트에서 gif 이미지가 제대로않나오네요..본문
갤러리 게시판에 gif 에니메이션이 되는 이미지를 올렸는데
에니메이션이 않되고 첫프레임만 뜨네요..
원래 그런가요? 클릭하고 들어가면 제대로 나오는데...
이미지가 나온는부분의 소스가 대략 이렇게 되는거 같습니다..
<?
for ($i=0; $i<count($list); $i++)
{
if ($i && $i%$mod==0)
echo "</tr><tr>";
$img = "<img src='$board_skin_path/img/noimage.gif' border=0 width='$board[bo_1]' title='이미지 없음'>";
$thumb = $thumb_path. "/". $list[$i][wr_id]. "_s";
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
break;
$large = get_size($size[0], $size[1], $board[bo_1]);
$dst = imagecreatetruecolor($large[0], $large[1]);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $large[0], $large[1], $size[0], $size[1]);
imagepng($dst, $thumb_path. "/". $list[$i][wr_id]. "_s", $board[bo_2]);
chmod($thumb_path. "/". $list[$i][wr_id]. "_s", 0606);
}
}
if (file_exists($thumb))
$img = "<img src='$thumb' border=0>";
$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 style='font-size:7pt;'>{$list[$i][comment_cnt]}</span></a>";
if ($is_category) {
// 분류명 가져오기
$ca_name = get_category_name($list[$i][ca_name]);
}
echo "<td width='{$td_width}%' valign=top style='word-break:break-all;'>";
echo "<table align='center'>";
echo "<tr><td height=5></td></tr>";
echo "<tr><td align=center>";
echo "<table border='0' cellspacing='0' cellpadding='3' style='border-width:1px; border-style:solid; border-color:#cccccc;'>";
echo "<tr><td align='center'><a href='{$list[$i][href]}'>$img</a></td></tr>";
echo "</table>";
echo "</td></tr>";
echo "<tr><td align='center'><a href='{$list[$i][href]}'><B>$subject</B> <br>{$list[$i][wr_1]}</a>{$comment_cnt} </td></tr>";
// if ($is_category) echo "<tr><td><a href='{$list[$i][ca_name_href]}'><font color=#cccccc>[$ca_name]</font></a></td></tr>";
if ($is_checkbox) echo "<tr><td align='center'><input type=checkbox name=chk_wr_id[] value='{$list[$i][wr_id]}'><br><br></td></tr>";
//echo "<tr><td height=5></td></tr>";
echo "</table></td>\n";
}
에니메이션이 않되고 첫프레임만 뜨네요..
원래 그런가요? 클릭하고 들어가면 제대로 나오는데...
이미지가 나온는부분의 소스가 대략 이렇게 되는거 같습니다..
<?
for ($i=0; $i<count($list); $i++)
{
if ($i && $i%$mod==0)
echo "</tr><tr>";
$img = "<img src='$board_skin_path/img/noimage.gif' border=0 width='$board[bo_1]' title='이미지 없음'>";
$thumb = $thumb_path. "/". $list[$i][wr_id]. "_s";
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
break;
$large = get_size($size[0], $size[1], $board[bo_1]);
$dst = imagecreatetruecolor($large[0], $large[1]);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $large[0], $large[1], $size[0], $size[1]);
imagepng($dst, $thumb_path. "/". $list[$i][wr_id]. "_s", $board[bo_2]);
chmod($thumb_path. "/". $list[$i][wr_id]. "_s", 0606);
}
}
if (file_exists($thumb))
$img = "<img src='$thumb' border=0>";
$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 style='font-size:7pt;'>{$list[$i][comment_cnt]}</span></a>";
if ($is_category) {
// 분류명 가져오기
$ca_name = get_category_name($list[$i][ca_name]);
}
echo "<td width='{$td_width}%' valign=top style='word-break:break-all;'>";
echo "<table align='center'>";
echo "<tr><td height=5></td></tr>";
echo "<tr><td align=center>";
echo "<table border='0' cellspacing='0' cellpadding='3' style='border-width:1px; border-style:solid; border-color:#cccccc;'>";
echo "<tr><td align='center'><a href='{$list[$i][href]}'>$img</a></td></tr>";
echo "</table>";
echo "</td></tr>";
echo "<tr><td align='center'><a href='{$list[$i][href]}'><B>$subject</B> <br>{$list[$i][wr_1]}</a>{$comment_cnt} </td></tr>";
// if ($is_category) echo "<tr><td><a href='{$list[$i][ca_name_href]}'><font color=#cccccc>[$ca_name]</font></a></td></tr>";
if ($is_checkbox) echo "<tr><td align='center'><input type=checkbox name=chk_wr_id[] value='{$list[$i][wr_id]}'><br><br></td></tr>";
//echo "<tr><td height=5></td></tr>";
echo "</table></td>\n";
}
댓글 전체