최신글 이미지 크기 조절이 안되요~
$img_width = 20; // $img_height = 20; 이렇게 이미지 크기 조절했는데 위의 사진과 같이 크게 나와서 글을 밀어내요 ㅠㅠ
해결법 부탁드려요~
또 한가지 질문은 사진의 맨위에 공연정보 이미지 테두리에 보라색이 갑자기 생겼는데 어떻게 없애나요?
해결법 부탁드려요~
또 한가지 질문은 사진의 맨위에 공연정보 이미지 테두리에 보라색이 갑자기 생겼는데 어떻게 없애나요?
첨부파일
|
댓글을 작성하시려면 로그인이 필요합니다.
댓글 5개
이미지크기는 소스를 한번 올려보시겠어요?
<?
if (!defined("_GNUBOARD_")) exit; // 개별 ?˜ì´ì§? ?‘ê·¼ 불ê?
$cols = 1; // ?´ë?ì§? ê°?로갯??// ?´ë?ì§? ?¸ë¡œ ê°?ˆ˜??ë©”ì¸?서 ì§???ì´??´ë?ì§? ??
$image_h = 1; // ?´ë?ì§? ?하 간격
$col_width = (int)(99 / $cols);
$img_width = 20; //?¸ë„¤??ê°?로길??
$img_height = 20; //?¸ë„¤???¸ë¡œê¸¸ì´
$img_quality = 100; //?¼ë¦¬??100?´í•˜ë¡??¤ì • ?¼ë? phpë²„ì „?서??10?´í•˜???˜ë¡œ 처리 ?????ˆì‚¼
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 ?´ìƒ ë²„ì „???¤ì¹˜?˜ì–´ ?ˆì–´???¬ìš©?????ˆëŠ” 갤러ë¦?게시???…니??");
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb_img_list'; //?¸ë„¤???´ë?ì§? ?성 ?”ë ‰? 리
@mkdir($thumb_path, 0707);
@chmod($thumb_path, 0707);
?><style type="text/css">
<!--
.style3 {font-size: x-small}
-->
</style>
<table width="180" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="8%" height="25" class="Blueb" style="padding-left:7"><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>"><img src="<?=$latest_skin_path?>/img/gong.gif"></td>
<td width="92%" align="right" style="padding-right:5"><a href="<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>"><img src="<?=$latest_skin_path?>/img/box02_more.gif" width="33" height="5" border="0"></a></td>
</tr>
<tr>
<td height="2" colspan="2"></td>
</tr>
<tr>
<td colspan="2" height="6"></td>
</tr>
</table>
<? for ($i=0; $i<count($list); $i++) { ?>
<?
$wr_content = "<a href='{$list[$i]['href']}'>".cut_str(strip_tags($list[$i]['wr_content']), 500, '...')."</a>";
// if ($i>0 && $i%$cols==0) { echo "<td colspan='$cols' height='$image_h'></td><tr>"; }
$img = "<img src='$g4_path/img/noimage.gif' border=1 width='$img_width' height='$img_height' title='?´ë?ì§? ?†ìŒ' align=left style='margin-right:5px; border:1 #222222 solid;'>";
$thumb = $thumb_path.'/'.$list[$i][wr_id];
// ?¬ë„¤?¼ê³¼ ?ˆë¡œ ?¬ë¦°?Œì¼ ? ì§œë¥?비êµ?˜ì—¬ ?ˆë„¤?¼ì„ ê°±ì‹ ?˜ê¸°?„í•´??ì§??´ë‹¤.
if ( file_exists($thumb) && (filemtime($thumb) < filemtime($list[$i][file][0][path] .'/'. $list[$i][file][0][file])) ) {
@unlink($thumb);
}
// ?¸ë„¤???´ë?ì§?ê°? ì¡´ì¬?˜ì? ?ŠëŠ”?¤ë©´
if (!file_exists($thumb)) {
$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
// ?…로?œëœ ?Œì¼???´ë?ì§??¼ë©´
//echo $i;
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 = $img_width / $size[0];
$height = (int)($size[1] * $rate);
$width = (int)($size[0] * $rate);
// 계산???¸ë„¤???´ë?ì§????’ì´ê°? ?¤ì •???´ë?ì§????’ì´ë³´ë‹¤ ?‘다ë©?
$dst = imagecreatetruecolor($img_width, $img_height);
if ($height < $img_height) { // 계산???´ë?ì§? ?’ì´ë¡?복사ë³??´ë?ì§? ?성
imagecopyresampled($dst, $src, 0, 0, 0, 0, $width, $img_height, $size[0], $size[1]);
imagepng($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
} else { // ?¤ì •???´ë?ì§? ?’ì´ë¡?복사ë³??´ë?ì§? ?성
imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
imagepng($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
}
//echo $i;
chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
}
}
if (file_exists($thumb))
$img = "<img src='$thumb' border=0>";
?>
<?
$datetime = substr($list[$i][wr_datetime],0,10);
$datetime2 = $list[$i][wr_datetime];
if ($list[$i]['wr_datetime'] >= date("Y-m-d H:i:s", $g4['server_time'] - ($row['bo_new'] * 3600))) $comment_new = "new";
if ($datetime == $g4[time_ymd])
$datetime2 = substr($datetime2,11,5);
else
$datetime2 = substr($datetime2,5,5);
$list[$i][datetime] = $datetime;
$list[$i][datetime2] = $datetime2;
$a[$i] = array(
"wr_date"=>$datetime2,
);
?>
<?
$rw_subject = cut_str(stripslashes($list[$i][subject]),$subject_size,'..');
$a_link="<a href='{$list[$i][href]}'>$rw_subject</a>";
$a_img="<a href='{$list[$i][href]}'>$img</a>";
$a_comment="<a href=\"{$list[$i][comment_href]}\"><span class='commentFont'>{$list[$i]['comment_cnt']}</span></a>";
$rw_content = cut_str(stripslashes($list[$i][wr_content]),$content_size,' ..more');
$rw_content = strip_tags($rw_content);
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><table width="95%" border="0" cellspacing="0" cellpadding="0" style="border-bottom-width:1; border-bottom-color:white; border-bottom-style:dashed;">
<tr>
<td width="23" height="58" valign="top"><table width="29%" border="0" cellpadding="2" cellspacing="1" >
<tr>
<td ><?=$a_img?></td>
</tr>
</table></td>
<td width="10"></td>
<td width="1093" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="4"><?
echo "<a href='{$list[$i]['href']}' class=\"b\">";
echo "<font style='font-family:??; font-size:9pt; color:#333333;'>{$list[$i]['subject']}";
echo "</a>";
?></td>
</tr>
<tr>
<td height="10"> <p>
<?=$wr_content?>
</p></td>
</tr>
<tr>
<td></td>
</tr>
<!--
<tr>
<td class="gray8A">ê¸??´ì´ : 매립?¸ì‚¬?´ë“œ</td>
</tr>
-->
</table></td>
</tr>
</table></td>
</tr><td height="10"></td>
</table>
<?
}
?>
if (file_exists($thumb))
$img = "<img src='$thumb' border=0>";
을
if (file_exists($thumb))
$img = "<img src='$thumb' width=원하는 넓이 height=원하는 높이 border=0>";
로 바꿔보세요.
그런데 사진이미지크기와 설정한 크기가 같은데도 사진 화질이 안좋게 나오는건 무엇때문이죠????ㅜㅜ
퀄리티 99나 100으로 해도 그래요 ㅠㅠ