리스트화면에 업로드된 두개의 이미지 모두 썸네일 만드는법좀 부탁드릴께요 정보
리스트화면에 업로드된 두개의 이미지 모두 썸네일 만드는법좀 부탁드릴께요본문
안녕하세요
<?
for ($i=0; $i<count($list); $i++)
{
$img = "<img src='$board_skin_path/img/noimage.gif' border=0 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
break;
for ($i=0; $i<count($list); $i++)
{
$img = "<img src='$board_skin_path/img/noimage.gif' border=0 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
break;
$rate = $board[bo_1] / $size[0];
$height = (int)($size[1] * $rate);
$height = (int)($size[1] * $rate);
$dst = imagecreatetruecolor($board[bo_1], $height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $board[bo_1], $height, $size[0], $size[1]);
imagepng($dst, $thumb_path.'/'.$list[$i][wr_id], $board[bo_2]);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
imagecopyresampled($dst, $src, 0, 0, 0, 0, $board[bo_1], $height, $size[0], $size[1]);
imagepng($dst, $thumb_path.'/'.$list[$i][wr_id], $board[bo_2]);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
if (file_exists($thumb))
$img = "<img src='$thumb' border=0 width='110' height='82'>";
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file))
?>
$img = "<img src='$thumb' border=0 width='110' height='82'>";
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
if (preg_match("/\.(jp[e]?g|gif|png)$/i", $file) && file_exists($file))
?>
<table border="0" width="112" cellpadding="1" cellspacing="0" bgcolor="#CCCCCC">
<tr>
<td><a href="javascript:void(0);" onClick="Center_Window('<?=$file?>');"><?=$img?</a></td>
<tr>
<tr>
<td><a href="javascript:void(0);" onClick="Center_Window('<?=$file?>');"><?=$img?</a></td>
<tr>
</table>
첫번째 파일을 썸네일 불러오는 소스같은데..
이런쪽을 너무 몰라서..
이미지파일을 두개를 업로드 하였습니다.
대부분의 갤러리는 첫번째 이미지만 썸네일을 만들어 리스트화면에 뿌려주는데..
전 두개의 이미지 모두 리스트 화면에 뿌려줄려고 합니다.
좋은방법 있으시면 부탁드립니다.
감사합니다.
댓글 전체
첫번째 이미지를 삭제한경우 나머지 첨부 이미지로 썸네일 만들기에 때한 다모아비즈님의 팁입니다.
http://www.sir.co.kr/bbs/tb.php/g4_qa/22484 도움이 되실것 같습니다.
http://www.sir.co.kr/bbs/tb.php/g4_qa/22484 도움이 되실것 같습니다.