메인화면 갤러리스킨 오류가 납니다 도와주세요!! > 그누4 질문답변

그누4 질문답변

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

메인화면 갤러리스킨 오류가 납니다 도와주세요!! 정보

메인화면 갤러리스킨 오류가 납니다 도와주세요!!

본문

오류가 나는곳의 주소를 알려주시면 더 빠르고 정확하게 답변 받을 수 있습니다.

오류 주소 : http://www.wooritravel.com.au/index.php

Warning: imagepng() [function.imagepng]: gd-png: fatal libpng error: zlib error in /home/woorit27/public_html/skin/latest/Ygallery_list/latest.skin.php on line 121

Warning: imagepng() [function.imagepng]: gd-png error: setjmp returns error condition in /home/woorit27/public_html/skin/latest/Ygallery_list/latest.skin.php on line 121

이런 오류가 나면서 이미지 엑박이 뜹니다 도와주세요 고수님들...ㅡ,.ㅡ

latest.skin.php소스는 아래와 같습니다
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

//썸네일 설정
$thumb_width = 180;//이미지 넓이
$thumb_height = 150;//이미지 높이
$thumb_quality = 90;//이미지 질
$mod = 4;//한줄에 몇개의 이미지 보여줄것인지 설정

//옵션 추가 사이트에 따라 썸네일에서 부분적으로 이미지가 짤리는 것을 원하지 않을수도 있어서 옵션을 추가함
$Ythumb_rule = 1;//1은 정비율 대로 줄이되 높이가 긴것은 짜름, 2는 정비율대로 모두 보여주되 긴쪽을 기준으로 함, 3은 정비율대로 보여주되 너비는 지정된 너비로 함

$td_width = (int)(100 / $mod);

$data_path = $g4['path'] . '/data/file/' . $bo_table;
$thumb_path = $data_path . '/thumb_' . $thumb_width . '_' . $thumb_height;

if (!is_dir($thumb_path)) {

  @mkdir($thumb_path, 0707);
  @chmod($thumb_path, 0707);
}

$old_thumb_height = $thumb_height;

?>

<style>
<!--
body, td, p, input, button, textarea, select, .c1 { font-family:Tahoma,굴림; font-size:9pt; color:#333333; }
img {border: none;}

a:link { text-decoration:none; color:#333333 }
a:visited  { text-decoration:none; color:#333333 }
a:active { text-decoration:none; color:#333333 }
a:hover { color:#777777; text-decoration:underline }
-->
</style>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="14"></td>
    <td align="center" style="padding:8, 0, 6, 0">
   
      <table width=100% cellpadding=0 cellspacing=0>
        <tr>
          <?

          for ($i = 0; $i < count($list); $i++){

            $thumb_height = $old_thumb_height;
            if ($i && $i%$mod == 0)
              echo "</tr><tr>";

              $num = -1;

              if (empty($board['bo_upload_count'])) $board['bo_upload_count'] = 5;

              for ($j = 0; $j < $board['bo_upload_count']; $j++) {

                $file[$i] = $list[$i]['file'][$j]['path'] .'/'. $list[$i]['file'][$j]['file'];
                if (is_file($file[$i]) && file_exists($file[$i])) {

                $num = $j;
                $thumb[$i] = $thumb_path . '/' . $list[$i]['file'][$j]['file'];
                break;
              }
            }

            if ($num != -1) {

              if (!is_file($thumb[$i]) || !file_exists($thumb[$i])){

                $size = @getimagesize($file[$i]);
                if ($size[2] == 1)
                  $src = imagecreatefromgif($file[$i]);
                else if ($size[2] == 2)
                  $src = imagecreatefromjpeg($file[$i]);
                else if ($size[2] == 3)
                  $src = imagecreatefrompng($file[$i]);
                else
                  continue;

                $rate = $size[1] / $size[0];
                $width = $thumb_width;
                $height = (int) ($rate * $thumb_width);

                if ($height > $thumb_height) {

                  if ($Ythumb_rule == 2){//정비율로 보여주되 긴쪽을 기준으로 삼음

                    $rate = $size[0] / $size[1];
                    $height = $thumb_height;
                    $width = (int) ($rate * $thumb_height);
                  }
                  else if ($Ythumb_rule == 3){//정비율로 보여주되 무조건 너비를 기준으로 삼음

                    $thumb_height = $height;
                  }
                }

                $x = 0;
                $y = 0;

                if ($width < $thumb_width){

                  $x = (($thumb_width - $width) / 2);
                }

                if ($height < $thumb_height){

                  $y = (($thumb_height - $height) / 2);
                }

                $dst = imagecreatetruecolor($thumb_width, $thumb_height);
                $background_color = imagecolorallocate($dst, 255, 255, 255);
                imagefilledrectangle( $dst, 0, 0, $thumb_width, $thumb_height, $background_color );

                imagecopyresampled($dst, $src, $x, $y, 0, 0, $width, $height, $size[0], $size[1]);

                imagepng($dst, $thumb[$i], $thumb_quality);
                chmod($thumb[$i], 0606);
              }
            }

            if (is_file($thumb[$i]) && file_exists($thumb[$i]))
              $img = "<img src='" . $thumb[$i] . "' border=0 style='border:1px solid #cccccc;'>";
            else
              $img = "<img src='$latest_skin_path/img/noimage.gif' border=0 width='" . $thumb_width . "'height='" . $thumb_height . "' title='이미지 없음'>";

            $style = "";
            if ($list[$i]['icon_new'])
              $style = " style='font-weight:bold; color:#fe7701' ";
            $subject = "<span $style>".$list[$i][subject]."</span>";

            $comment_cnt = "";
            if ($list[$i]['comment_cnt'])
              $comment_cnt = " <a href=\"{$list[$i][comment_href]}\"><span style='font-size:7pt;'>{$list[$i][comment_cnt]}</span></a>";

            ?>

            <td width='<?=$td_width?>%' valign=bottom style='word-break:break-all;'>
              <table width=100% cellspacing=0 cellpadding=0>
                <tr><td height=5></td></tr>
                <tr><td align=center><a href='<?=$list[$i]['href']?>'><?=$img?></a></td></tr>
                <tr>
                  <td align=center><a href='<?=$list[$i]['ca_name_href']?>'><font color="#cccccc">[</font></a><a href='<?=$g4[bbs_path]?>/board.php?bo_table=<?=$bo_table?>'><b><?=$board[bo_subject]?></b></a><a href='<?=$list[$i]['ca_name_href']?>'><font color="#cccccc">]</font></a><a href='<?=$list[$i]['href']?>'><font color=fe7701><?=$subject?></font></a></td>
                </tr>
                <tr><td align=center><?=$list[$i]['wr_1']?></td></tr>

                <? if ($is_category) {?>
                <tr><td align=center><a href='<?=$list[$i]['ca_name_href']?>'><font color=#cccccc>[<?=$list[$i]['ca_name']?>]</font></a></td></tr>
                <? }?>

                <? if ($is_checkbox) {?>
                <tr><td align=center><input type=checkbox name=chk_wr_id[] value='<?=$list[$i]['wr_id']?>'></td></tr>
                <? }?>
                <tr><td height=10></td></tr>
              </table>            </td>

          <?
          }

             

          // 나머지 td
          $cnt = $i % $mod;
          if ($cnt > 0) {
            for ($i=$cnt; $i<$mod; $i++) {

              ?>

            <td width='<?=$td_width?>%'>&nbsp;</td>

              <?
            }
          }

          ?>

          <? if (count($list) == 0) { ?>
          <td colspan='$mod' height=100 align=center>게시물이 없습니다.</td>
          <? } ?>
        </tr>
      </table>    </td>
    <td width="14"></td>
  </tr>
</table>
  • 복사

댓글 전체

php.net에서 참조하자면 imgpng의 세번째 값은 0에서 9까지입니다. 0은 압축하지 않는 것이구요. 그런데 세번째 값인 $thumb_quality를 처음 정의할 때 "$thumb_quality = 90;//이미지 질 "라고 하셨기 때문에 gd 압축 에러가 난 겁니다. 0-9까지의 값을 주고 해 보세요.

관련 정보는 여기서 얻었습니다. http://bonsai.php.net/bug.php?id=46751&edit=1
© SIRSOFT
현재 페이지 제일 처음으로