이미지 퀄리티 관련질문입니다. 정보
이미지 퀄리티 관련질문입니다.본문
댓글 전체
정확한건 소르를 봐야알거 같습니다...
소스를 같이 올려주세용
소스를 같이 올려주세용
소스입니다 알려주세요 ㅠㅠ
<?
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>
<?
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);
이부분을 두 스킨을 잘 비교해 보세요.
$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);
이부분을 두 스킨을 잘 비교해 보세요.