원래 그림 싸이즈는 큰데 추출하면 작아져요 정보
원래 그림 싸이즈는 큰데 추출하면 작아져요본문
그림처럼 짤리고 이미지를 키울시 흐릿하게 나와요
원본 사이즈는 크구요 .. 그리고 다른 이미지 로 추출하면 크게 나오는데
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$img_width = 150;
$img_height = 150;
$img_quality = 99;
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path."thumbnail/$row[wr_id]";
$ym = date("ym", $g4[server_time]);
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>
<style>
.dm-subject { font:bold; font-size:18px; color:#000000; padding:5 10 5 5; }
.dm-hit { text-align:center; font:bold; font-size:14px; color:#e95eee; }
*html #ixwd_2{width: 670px!important;}
</style>
<div id="ixwd_2" style="position: relative; width: 670px; padding-left: 0px;">
<? for ($i=0; $i<count($list); $i++) { ?>
<div style="float: left; padding: 17px 0 0 10px;">
<?
//썸네일 생성
$thumfile = "";
$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)) {
$rate = $img_width / $size[0];
$height = (int)($size[1] * $rate);
// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $img_height)
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $height);
else
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $img_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
if (file_exists($thumb))
$thumfile = "<img src='$thumb' width='{$img_width}' height='{$img_height}' border='0' style='border:0 #eee solid' onmouseover=this.style.filter='alpha(opacity=80)' onmouseout=this.style.filter=''></a>";
else
//이미지가 없으면
$thumfile="<img src='$latest_skin_path/img/noimg.gif' width='{$img_width}' height='{$img_height}' style='border:0 #E7E7E7 solid'></a>";
//이미지가 아니네
if(preg_match("/\.(swf|wma|asf)$/i","$file") && file_exists($file))
{ $thumfile = "<script>doc_write(flash_movie('$file', 'flash$i', '$img_width', '$img_height', 'transparent'));</script>"; }
?><a href='<?=$list[$i][href]?>'><?=$thumfile?></a>
<div style='text-align: center;'>
<div style="padding: 5px 0 0 0; font-family: Small Fonts; font-size: 11px;">
<table border=0 cellpadding=0 cellspacing=0>
<tr height=30>
<tr>
<td><font color=cf4911>제목 :</font><a href='<?=$list[$i][href]?>'><?=cut_str($list[$i][subject], 20)?></a> </td>
</tr>
<tr height=30>
<td><font color=cf4911>장르/기타</font> : <a href="<?=$list[$i][ca_name_href]?>"><?=$list[$i][ca_name]?></a></td>
</tr>
</table>
</div>
</div>
</div>
<? } ?>
<? if (count($list) == 0) { ?><div style="padding: 10px 0 0 10px;">게시물이 없습니다.</div><? } ?>
</div>
소스 어디가 잘못되었나요 짜집기 해서.. 필요 없는 소스좀 삭제도 해주시면 감사하겠습니다.
원본 사이즈는 크구요 .. 그리고 다른 이미지 로 추출하면 크게 나오는데
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
$img_width = 150;
$img_height = 150;
$img_quality = 99;
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path."thumbnail/$row[wr_id]";
$ym = date("ym", $g4[server_time]);
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>
<style>
.dm-subject { font:bold; font-size:18px; color:#000000; padding:5 10 5 5; }
.dm-hit { text-align:center; font:bold; font-size:14px; color:#e95eee; }
*html #ixwd_2{width: 670px!important;}
</style>
<div id="ixwd_2" style="position: relative; width: 670px; padding-left: 0px;">
<? for ($i=0; $i<count($list); $i++) { ?>
<div style="float: left; padding: 17px 0 0 10px;">
<?
//썸네일 생성
$thumfile = "";
$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)) {
$rate = $img_width / $size[0];
$height = (int)($size[1] * $rate);
// 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
if ($height < $img_height)
// 계산된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $height);
else
// 설정된 이미지 높이로 복사본 이미지 생성
$dst = imagecreatetruecolor($img_width, $img_height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
imagejpeg($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
if (file_exists($thumb))
$thumfile = "<img src='$thumb' width='{$img_width}' height='{$img_height}' border='0' style='border:0 #eee solid' onmouseover=this.style.filter='alpha(opacity=80)' onmouseout=this.style.filter=''></a>";
else
//이미지가 없으면
$thumfile="<img src='$latest_skin_path/img/noimg.gif' width='{$img_width}' height='{$img_height}' style='border:0 #E7E7E7 solid'></a>";
//이미지가 아니네
if(preg_match("/\.(swf|wma|asf)$/i","$file") && file_exists($file))
{ $thumfile = "<script>doc_write(flash_movie('$file', 'flash$i', '$img_width', '$img_height', 'transparent'));</script>"; }
?><a href='<?=$list[$i][href]?>'><?=$thumfile?></a>
<div style='text-align: center;'>
<div style="padding: 5px 0 0 0; font-family: Small Fonts; font-size: 11px;">
<table border=0 cellpadding=0 cellspacing=0>
<tr height=30>
<tr>
<td><font color=cf4911>제목 :</font><a href='<?=$list[$i][href]?>'><?=cut_str($list[$i][subject], 20)?></a> </td>
</tr>
<tr height=30>
<td><font color=cf4911>장르/기타</font> : <a href="<?=$list[$i][ca_name_href]?>"><?=$list[$i][ca_name]?></a></td>
</tr>
</table>
</div>
</div>
</div>
<? } ?>
<? if (count($list) == 0) { ?><div style="padding: 10px 0 0 10px;">게시물이 없습니다.</div><? } ?>
</div>
소스 어디가 잘못되었나요 짜집기 해서.. 필요 없는 소스좀 삭제도 해주시면 감사하겠습니다.
댓글 전체
대충봐서 그런지 소스에는 큰 문제가 없어 보이는데요...
150*150 픽셀로 썸네일을 만들었고
불러오는 썸네일 크기도 150*150 이니 깨져보이는 이유는 없습니다.
다만...혹시 이전에 만들었던 썸네일이 작은 경우일지도 모르니
일단 /data/file/게시판 테이블/thumbnail/ 안에 있는 1 2 3 4 이런 파일들을 싹 지워보세요.
기존의 썸네일을 지우면 다시 생성 될 겁니다.
150*150 픽셀로 썸네일을 만들었고
불러오는 썸네일 크기도 150*150 이니 깨져보이는 이유는 없습니다.
다만...혹시 이전에 만들었던 썸네일이 작은 경우일지도 모르니
일단 /data/file/게시판 테이블/thumbnail/ 안에 있는 1 2 3 4 이런 파일들을 싹 지워보세요.
기존의 썸네일을 지우면 다시 생성 될 겁니다.