최신글 이미지 크기 조절이 안되요~ > 그누4 질문답변

매출이 오르면 내리는 수수료! 지금 수수료센터에서 전자결제(PG)수수료 비교견적 신청해 보세요!

그누4 질문답변

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

최신글 이미지 크기 조절이 안되요~ 정보

최신글 이미지 크기 조절이 안되요~

본문

$img_width = 20; // $img_height = 20;  이렇게 이미지 크기 조절했는데 위의 사진과 같이 크게 나와서 글을 밀어내요 ㅠㅠ
해결법 부탁드려요~

또 한가지 질문은 사진의 맨위에 공연정보 이미지 테두리에 보라색이 갑자기 생겼는데 어떻게 없애나요?

댓글 전체

보라색으로 나오는 것은 <img src="이미지경로" border=0>로 border값을 지정해주면 됩니다.

이미지크기는 소스를 한번 올려보시겠어요?
답변 감사합니다^^ 아래는 소스입니다~

<?
if (!defined("_GNUBOARD_")) exit; // &ecirc;°œ&euml;³„ ?&#732;&igrave;&#157;´&igrave;§? ?‘&ecirc;·¼ &euml;¶&#710;&ecirc;?

$cols  = 1; //  ?´&euml;?&igrave;§? &ecirc;°?&euml;¡œ&ecirc;°&macr;??//  ?´&euml;?&igrave;§? ?¸&euml;¡œ &ecirc;°?&#710;&#732;??&euml;&copy;”&igrave;&#157;¸?&#144;&igrave;„œ &igrave;§???&igrave;´??´&euml;?&igrave;§? ??
$image_h  = 1; // ?´&euml;?&igrave;§? ?&#129;&iacute;•&#732; &ecirc;°„&ecirc;²&copy;
$col_width = (int)(99 / $cols);

$img_width = 20; //?¸&euml;„¤??&ecirc;°?&euml;¡œ&ecirc;¸¸??
$img_height = 20; //?¸&euml;„¤???¸&euml;¡œ&ecirc;¸¸&igrave;&#157;´
$img_quality = 100; //?¼&euml;&brvbar;&not;??100?´&iacute;•&#732;&euml;¡??¤&igrave;&nbsp;• ?¼&euml;? php&euml;²„&igrave;&nbsp;„?&#144;&igrave;„œ??10?´&iacute;•&#732;???&#732;&euml;¡œ &igrave;²&#732;&euml;&brvbar;&not; ?????&#710;&igrave;‚¼

if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 ?´&igrave;&#402;&#129; &euml;²„&igrave;&nbsp;„???¤&igrave;¹&#732;?&#732;&igrave;–´ ?&#710;&igrave;–´???&not;&igrave;&#353;&copy;?????&#710;&euml;&#352;” &ecirc;°¤&euml;&#376;&not;&euml;&brvbar;?&ecirc;²Œ&igrave;‹œ???…&euml;‹&#710;??");

$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb_img_list'; //?¸&euml;„¤???´&euml;?&igrave;§? ?&#157;&igrave;„± ?”&euml;&nbsp;‰?&nbsp;&euml;&brvbar;&not;

@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='?´&euml;?&igrave;§? ?†&igrave;&#157;Œ' align=left style='margin-right:5px; border:1 #222222 solid;'>";
    $thumb = $thumb_path.'/'.$list[$i][wr_id];


// ?&not;&euml;„¤?¼&ecirc;³¼ ?&#710;&euml;¡œ ?&not;&euml;&brvbar;°?Œ&igrave;&#157;¼ ?&nbsp;&igrave;§œ&euml;&yen;?&euml;¹„&ecirc;&micro;&#144;?&#732;&igrave;—&not; ?&#710;&euml;„¤?¼&igrave;&#157;„ &ecirc;°±&igrave;‹&nbsp;?&#732;&ecirc;¸°?„&iacute;•´??&igrave;§??´&euml;‹¤.
if ( file_exists($thumb) && (filemtime($thumb) < filemtime($list[$i][file][0][path] .'/'. $list[$i][file][0][file])) ) {
@unlink($thumb);
}

    // ?¸&euml;„¤???´&euml;?&igrave;§?&ecirc;°? &igrave;¡´&igrave;&#158;&not;?&#732;&igrave;? ?&#352;&euml;&#352;”?¤&euml;&copy;´
    if (!file_exists($thumb)) {
        $file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];
        // ?…&euml;¡œ?œ&euml;&#144;œ ?Œ&igrave;&#157;¼???´&euml;?&igrave;§??¼&euml;&copy;´
//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);

            // &ecirc;³„&igrave;‚°???¸&euml;„¤???´&euml;?&igrave;§????’&igrave;&#157;´&ecirc;°? ?¤&igrave;&nbsp;•???´&euml;?&igrave;§????’&igrave;&#157;´&euml;³´&euml;‹¤ ?‘&euml;‹¤&euml;&copy;?
            $dst = imagecreatetruecolor($img_width, $img_height);

            if ($height < $img_height) {                // &ecirc;³„&igrave;‚°???´&euml;?&igrave;§? ?’&igrave;&#157;´&euml;¡?&euml;³&micro;&igrave;‚&not;&euml;³??´&euml;?&igrave;§? ?&#157;&igrave;„±
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 {  // ?¤&igrave;&nbsp;•???´&euml;?&igrave;§? ?’&igrave;&#157;´&euml;¡?&euml;³&micro;&igrave;‚&not;&euml;³??´&euml;?&igrave;§? ?&#157;&igrave;„±
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">&ecirc;¸??´&igrave;&#157;´ : &euml;§¤&euml;&brvbar;½?¸&igrave;‚&not;?´&euml;“œ</td>
          </tr>
-->         
        </table></td>
      </tr>
    </table></td>
</tr><td height="10"></td>
</table>
                                                                         
                                          <?
}
?>
올려주신 파일에서 87번째줄.

    if (file_exists($thumb))
        $img = "<img src='$thumb' border=0>";



    if (file_exists($thumb))
        $img = "<img src='$thumb' width=원하는 넓이 height=원하는 높이 border=0>";

로 바꿔보세요.
앗! 감사합니다~!! 덕분에 해결 되었어요^^

그런데 사진이미지크기와 설정한 크기가 같은데도 사진 화질이 안좋게 나오는건 무엇때문이죠????ㅜㅜ
퀄리티 99나 100으로 해도 그래요 ㅠㅠ
전체 66,558 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT