이미지 퀄리티 관련질문입니다.

· 17년 전 · 1352 · 5
1.jpg
2.jpg
첫번째 이미지는 웹진형 게시판 리스트에 출력된 이미지이고 두번째 이미지는 최신글에 출력된 이미지 입니다.
둘다 같은 이미지인데 최신글에서 출력되는 이미지는 위에 이미지에 나오는것처럼 화질이 안좋게 나오나요?
퀄리티 100을 해도 화질이 안좋게 출력되는데 해결 방법이 뭔가요??

첨부파일

1.jpg (20.3 KB)
0회 2009-02-09 20:39
2.jpg (21.1 KB)
0회 2009-02-09 20:39
|

댓글 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);

이부분을 두 스킨을 잘 비교해 보세요.
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

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

+
제목 글쓴이 날짜 조회
17년 전 조회 848
17년 전 조회 941
17년 전 조회 900
17년 전 조회 979
17년 전 조회 782
17년 전 조회 859
17년 전 조회 1,555
17년 전 조회 1,139
17년 전 조회 1,786
17년 전 조회 1,353
17년 전 조회 1,043
17년 전 조회 806
17년 전 조회 799
17년 전 조회 957
17년 전 조회 973
17년 전 조회 786
17년 전 조회 794
17년 전 조회 997
17년 전 조회 769
17년 전 조회 896