M

기본 스킨 gd_gallery

php 4에서 5로 업그레이드 후 섬네일이 생성되지 않습니다.
 
GD Support enabled
GD Version bundled (2.0.28 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.1.5
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
 
GD는 아파치에 정상적으로 인크루드 된 것 같은데
어디를 고쳐야 할까요?
 
아래는 gd_gallery의 write_update.skin.php입니다.
 
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 자신만의 코드를 넣어주세요.
//print_r2($_FILES); exit;
$data_path = $g4[path]."/data/file/$bo_table";
$thumb_path = $data_path.'/thumb';
if ($_FILES[bf_file][name][0])
{
    $row = sql_fetch(" select * from $g4[board_file_table] where bo_table = '$bo_table' and wr_id = '$wr_id' and bf_no = '0' ");
    $file = $data_path .'/'. $row[bf_file];
    if (preg_match("/\.(jp[e]?g|gif|png)$/i", $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 = $board[bo_1] / $size[0];
        $height = (int)($size[1] * $rate);
        @unlink($thumb_path.'/'.$wr_id);
        $dst = imagecreatetruecolor($board[bo_1], $height);
        imagecopyresampled($dst, $src, 0, 0, 0, 0, $board[bo_1], $height, $size[0], $size[1]);
        imagepng($dst, $thumb_path.'/'.$wr_id, $board[bo_2]);
        chmod($thumb_path.'/'.$wr_id, 0606);
    }
}
?>
|

댓글 2개

Fatal error: imagepng() [<a href='function.imagepng'>function.imagepng</a>]: gd-png: fatal libpng error: zlib error in /home/mig29/www/bbs/skin/board/gd_gallery/list.skin.php on line 90

이런 에러가 뜨는군요..
imagepng($dst, $thumb_path.'/'.$wr_id, $board[bo_2]);

임시 대처 방법.
png 부분을 gif 혹은 jpeg로 바꿔보세요...
댓글을 작성하시려면 로그인이 필요합니다.

그누4 질문답변

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

+
제목 글쓴이 날짜 조회
19년 전 조회 1,928
19년 전 조회 1,034
19년 전 조회 1,008
19년 전 조회 1,609
19년 전 조회 1,541
19년 전 조회 1,438
19년 전 조회 1,545
19년 전 조회 977
19년 전 조회 1,138
19년 전 조회 1,625
19년 전 조회 1,539
19년 전 조회 1,294
19년 전 조회 1,531
19년 전 조회 1,655
19년 전 조회 1,271
19년 전 조회 1,474
19년 전 조회 1,453
19년 전 조회 1,571
19년 전 조회 2,616
19년 전 조회 1,667