썸네일 이미지가 안보입니다.

썸네일 이미지가 안보입니다.

QA

썸네일 이미지가 안보입니다.

본문

썸네일도 정상적으로 만들어 지는데 첨부 이미지를 못가져 오는 이유좀 얄려주세요

첨부파일이 있던 없던 무조건 <img src='$latest_skin_url/img/noimage.gif' width='$img_width' height='$img_height' title='이미지 없음'>이것만 뿌려지네요

 

<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!function_exists("imagecopyresampled")) alert("GD 2.0.1 이상 버전이 설치되어 있어야 사용할 수 있는 갤러리 게시판 입니다.");

$img_width = '100'; //썸네일 가로길이
$img_height = '80'; //썸네일 세로길이
$img_quality = '9'; //퀼리티 100이하로 설정
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb105'; //썸네일 이미지 생성 디렉토리

($thumb_path, 0707);
@chmod($thumb_path, 0707);
?>
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<?  for ($i=0; $i<count($list); $i++) {
 
 $img = "<table border='0' cellpadding='0' cellspacing='0'>
    <tr>
     <td width='20'><img src='$latest_skin_url/img/box_01.gif' width='20' height='16'></td>
     <td  background='$latest_skin_url/img/box_03.gif'><img src='$latest_skin_url/img/box_02.gif' width='17' height='16'></td>
     <td width='21'><img src='$latest_skin_url/img/box_06.gif' width='21' height='16'></td>
    </tr>
    <tr>
     <td valign='top' background='$latest_skin_url/img/box_12.gif'><img src='$latest_skin_url/img/box_07.gif' width='20' height='20'></td>
     <td><img src='$latest_skin_url/img/noimage.gif' width='$img_width' height='$img_height' title='이미지 없음'></td>
     <td valign='bottom' background='$latest_skin_url/img/box_10.gif'><img src='$latest_skin_url/img/box_14.gif' width='21' height='15'></td>
    </tr>
    <tr>
     <td><img src='$latest_skin_url/img/box_15.gif' width='20' height='16'></td>
     <td background='$latest_skin_url/img/box_16.gif'><div align='right'><img src='$latest_skin_url/img/box_18.gif' width='20' height='16'></div></td>
     <td><img src='$latest_skin_url/img/box_19.gif' width='21' height='16'></td>
   </tr>
  </table>";
    $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 = $img_width / $size[0];
            $height = (int)($size[1] * $rate);

            // 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
            if ($height < $img_height)
                // 계산된 이미지 높이로 복사본 이미지 생성
                $dst = imagecreatetruecolor($img_width, $height);
            else
                // 설정된 이미지 높이로 복사본 이미지 생성
                $dst = imagecreatetruecolor($img_width, $img_height);
            imagecopyresampled($dst, $src, 0, 0, 0, 0, $img_width, $height, $size[0], $size[1]);
            imagepng($dst, $thumb_path.'/'.$list[$i][wr_id], $img_quality);
            chmod($thumb_path.'/'.$list[$i][wr_id], 0606);
  }
  }

  if (file_exists($thumb)){
        $img = "<table border='0' cellpadding='0' cellspacing='0'>
     <tr>
      <td width='20'><img src='$latest_skin_url/img/box_01.gif' width='20' height='16'></td>
      <td  background='$latest_skin_url/img/box_03.gif'><img src='$latest_skin_url/img/box_02.gif' width='17' height='16'></td>
      <td width='21'><img src='$latest_skin_url/img/box_06.gif' width='21' height='16'></td>
     </tr>
     <tr>
      <td valign='top' background='$latest_skin_url/img/box_12.gif'><img src='$latest_skin_url/img/box_07.gif' width='20' height='20'></td>
      <td align='center'><a href='{$list[$i][href]}'><img src='$thumb' width='$img_width' height='$img_height' border='0'></a></td>
      <td valign='bottom' background='$latest_skin_url/img/box_10.gif'><img src='$latest_skin_url/img/box_14.gif' width='21' height='15'></td>
     </tr>
     <tr>
      <td><img src='$latest_skin_url/img/box_15.gif' width='20' height='16'></td>
      <td background='$latest_skin_url/img/box_16.gif'>
       <div align='right'><img src='$latest_skin_url/img/box_18.gif' width='20' height='16'></div></td>
      <td><img src='$latest_skin_path/img/box_19.gif' width='21' height='16'></td>
     </tr>
    </table>";
  }
?>
 <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><?=$img?></td>
      <td align="center" valign="top" width="100%">
      <table border="0" cellpadding="0" cellspacing="0" width="100%">
       <? for ($i=0; $i<count($list); $i++) { ?>
       <tr height="23">
       <td><b>ㆍ</b>
       <?
       //날짜표시
       $date = explode("-", $date1);
       $year = $date[0];
       $month = $date[1];
       $day = $date[2];
       $latest_date = $year."-".$month."-".$day."";
       echo $list[$i]['icon_reply'] . " ";
       echo "<a href='{$list[$i]['href']}'>";
       if ($list[$i]['is_notice'])
        echo "<strong>{$list[$i]['subject']}</strong>";
       else
        echo "{$list[$i]['subject']}";
       echo "</a>";

       if ($list[$i]['comment_cnt'])
        echo " <a href=\"{$list[$i]['comment_href']}\" style='font-size:9px; color:#EE5A00; vertical-align:1px;'>{$list[$i]['comment_cnt']}</a>";
       echo " " . $list[$i]['icon_new'];
       echo " " . $list[$i]['icon_hot'];
       //echo " " . $list[$i]['icon_file'];
       echo " " . $list[$i]['icon_link'];
       //echo " " . $list[$i]['icon_secret'];
       echo "</td><td width=36 align=right>";
       echo "<font color=#bababa class=small>{$list[$i][datetime2]}</font> </td>";
       ?></td></tr><? } ?>
       
      </table>
      
      </td>
     </tr>
    </table>
    </td>
   </tr>
  </table>
  </td>
 </tr>
  <?}?>
<? if (count($list) == 0) { ?><tr><td align=center width="100%" height="117"><font color=#6A6A6A>현재 등록된 글이 없습니다.</a></td></tr><? } ?>
</table>

이 질문에 댓글 쓰기 :

답변 2

사용하고 있는 테마나 스킨, 플러그인의 충돌로 인해 이미지가 보이지 않을 수 있으니 베이직 테마나 기본스킨으로 복구하고 문제가 될만한 플러그인 등을 중지하여 이미지가 정상적으로 보여지는지 확인해 보세요.

아래 내용 보시면 알지만 아무것도 없습니다.

head.php나 tail.php는 install시 생성된 것을 사용했는데  안되니 모르겠습니다.

 

<?php
include_once('./_common.php');
if (G5_IS_MOBILE) {
    include_once(G5_MOBILE_PATH.'/page/test.php');
    return;
}
 
if(!$is_admin && $group['gr_device'] == 'mobile')
    alert($group['gr_subject'].' 그룹은 모바일에서만 접근할 수 있습니다.');
$g5['title'] = "test page";
include_once('./_head.php');
//include_once(G5_LIB_PATH.'/latest.lib.php');
?>

<?=latest('tab', "05_2", 4, 13, "height=80");

include_once('./_tail.php');
?>

답변을 작성하시기 전에 로그인 해주세요.
전체 123,715 | RSS
QA 내용 검색

회원로그인

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