이미지 퀄리티 관련질문입니다.
첫번째 이미지는 웹진형 게시판 리스트에 출력된 이미지이고 두번째 이미지는 최신글에 출력된 이미지 입니다.
둘다 같은 이미지인데 최신글에서 출력되는 이미지는 위에 이미지에 나오는것처럼 화질이 안좋게 나오나요?
퀄리티 100을 해도 화질이 안좋게 출력되는데 해결 방법이 뭔가요??
둘다 같은 이미지인데 최신글에서 출력되는 이미지는 위에 이미지에 나오는것처럼 화질이 안좋게 나오나요?
퀄리티 100을 해도 화질이 안좋게 출력되는데 해결 방법이 뭔가요??
|
댓글을 작성하시려면 로그인이 필요합니다.
댓글 5개
소스를 같이 올려주세용
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!$board[bo_1]) alert("해당 게시판 설정 : 여분 필드 1 에 목록에서 보여질 이미지의 폭을 설정하십시오. (픽셀 단위)");
if (!$board[bo_2]) alert("해당 게시판 설정 : 여분 필드 2 에 목록에서 보여질 이미지의 질(quality)을 비율로 설정하십시오. (100 이하)");
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 스킨 입니다.");
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
$tot=count($list);
?>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
<? for ($i=0; $i<count($list); $i++) {
$img = $latest_skin_path."/img/no_image.gif";
$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);
$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);
}
}
if (file_exists($thumb))
$img = $thumb;
?>
<tr>
<td colspan="2" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr height="6"><td></td></tr>
<tr>
<td valign=top>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td><a href='<?=$list[$i][href]?>'><img src="<?=$img?>" width="138" height="96" border="0"></a></td>
<td align="center" valign="top" width="100%">
<table width="98%" border="0" cellspacing="1" cellpadding="2" align="center">
<?
for ($i=0; $i<count($list); $i++) {
$subject = $list[$i]['subject']?"[".$list[$i]['subject']."] ":"";
?>
<tr>
<td>
<?
echo "ㆍ";
echo "<a href='{$list[$i][href]}'>";
echo $subject;
echo "{$list[$i]['wr_subject']}</a>";
echo " ". $list[$i]['icon_new'];
?>
</td>
</tr>
<? }?>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<?}?>
<? if (count($list) == 0) { ?><tr><td align=center>게시물이 없습니다.</td></tr><? } ?>
</table>
$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);
이부분을 두 스킨을 잘 비교해 보세요.