테스트 사이트 - 개발 중인 베타 버전입니다

최신글에서 gif 이미지가 검게 나옵니다. 채택완료

크리스리 10년 전 조회 3,679

급하게 질문 올립니다.

 

게시판에서 게시물을 올릴때 이미지를 gif를 업로드 하면 최신글에서 검은색으로 나오는데요

 

어디를 어떻게 수정해야 이 증상이 사라질지 좀 알려주시면 감사하겠습니다ㅠ

 


인물사진인데 이렇게 나옵니다

 

 

 

if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가 

 

/*

 *     latest.skin Gallery for Gnuboard4

 *    latest.skin.php

 *      

 *      Copyright 2011 Man Hyung, cho

 *      

 *      File encoding: Korean(EUC-KR)

 * 

 */

 

$cols  = 8; //  이미지 가로갯수 //  이미지 세로 갯수는 메인에서 지정(총 이미지 수)

$image_h  = 30; // 이미지 상하 간격

$is_crop = 2;

// $is_crop     : 세로 높이가 $height를 넘을 때 crop 할 것인지를 결정

//                0 : crop 하지 않습니다

//                1 : 기본 crop

//                2 : 중간을 기준으로 crop

$col_width = (int)(99 / $cols);

 

 

//불당썸---------------------------------------------------------------//

$img_width = 94; //표시할 이미지의 가로사이즈

$img_height = 120; //표시할 이미지의 세로사이즈 

 

 

//언샾마스트 퀄리티(썸 노이즈바지)

$filter[type] = 99; 

$filter[arg1] = 100;

$filter[arg2] = 1;

$filter[arg3] = 2;

 

$data_path = $g4[path]."/data/file/$bo_table";

$thumb_path = $data_path.'/thumb';

$no_img = $latest_skin_path."/img/no_img.gif"; 

 

// 불당썸을 include

include_once("$g4[path]/lib/thumb.lib.php");

//불당썸---------------------------------------------------------------//

 

 

// $list_content = "40"; //내용길이

?>

 

 

 

 if ($i>0 && $i%$cols==0) { 

 echo "

"; 

?>

 

 

 

$cnt = ($i%$cols); 

for ($k=$cnt; $k<$cols && $cnt; $k++) { 

echo "

"; 

?> 

게시물이 없습니다."; } ?>

   

   

       

   

   

   

 

 

//썸네일 생성

$thumfile = "";

$thumb = $thumb_path.'/'.$list[$i][wr_id];

 

//$file = "$g4[path]/data/file/$bo_table/".urlencode($list[$i][file][0][file]);

$file = $list[$i][file][0][path] .'/'. $list[$i][file][0][file];

//$noimg = "$latest_skin_path/img/noimg.gif";

 

// 업로드된 파일이 이미지라면

//if (preg_match("/\.(gif|jp[e]?g|png|bmp)$/i", $file) && file_exists($file)) { 

 

if (preg_match("/\.(jpg|gif|png|bmp)$/i", $file) && file_exists($file)) { 

//$img=thumbnail($data_path. "/".$image, $imgwidth, $imgheight, 0, 1);  //썸네일이 없을경우 원본출력 

$thumb = thumbnail($file, $img_width, $img_height, 0, $is_crop, 90, 0, "",  $filter, $noimg); //언샾마스크추가

 

 

 

} else { //에디터에서 삽입한 이미지

$edit_img = $list[$i]['wr_content'];

if (eregi("data/cheditor4[^<>]*\.(gif|jp[e]?g|png|bmp)", $edit_img, $tmp)) { // data/cheditor------

$file = $g4[path].'/' . $tmp[0]; // 파일명

$thumb=thumbnail($file, $img_width, $img_height, 0, $is_crop, 90, 0, "",  $filter, $noimg); //언샾마스크추가

 

}

 

//if (file_exists($thumb)) {

//$thumfile = "";

 

if (preg_match("/\.(jpg|gif|png|bmp)$/i", $thumb) && file_exists($thumb)) {

echo "

";

echo "

"; 

echo "

";

echo ""; 

echo "

{$list[$i]['subject']}"; 

echo "

"; 

}

 

 

else if (!file_exists($list[$i][file_image0])){ // no img

echo "

";

echo "

"; 

echo "

";

echo ""; 

echo "

{$list[$i]['subject']}"; 

echo "

"; 

}

 

?>

 

 

 

 

 

 

댓글을 작성하려면 로그인이 필요합니다.

답변 2개

채택된 답변
+20 포인트
10년 전

$filter​ 효과 때문에 그런것 같네요. 올려주신 내용에서 썸네일 생성 코드를 이렇게 해보세요.

$thumb = thumbnail($file, $img_width, $img_height, 0, $is_crop, 90, 0);

 

수정후에 data 폴더에서 해당 게시판 폴더내의 썸네일 폴더를 지우시고 썸네일이 재생성되야 반영될겁니다.

로그인 후 평가할 수 있습니다

답변에 대한 댓글 1개

크리스리
10년 전
정확히 해결되었습니다 정말 감사드려요^.^

댓글을 작성하려면 로그인이 필요합니다.

gif는 썸네일 생성에 관련된 함수가 없기 때문에 그런것 같습니다. 

 

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인