저장된 갤러리 이미지가 이상하네요 ^^ > 그누4 플러그인

그누4 플러그인

그누보드에는 여러가지 기능 추가가 쉽도록 제작 되었습니다.
플러그인의 저작권은 해당 플러그인 제작자님께 있으며, 그누보드의 저작권과 다를 수 있습니다.
플러그인 다운로드시 좋아요와 감사의 코멘트를 남기시면 제작자에게 큰 힘이됩니다. ^^y

저장된 갤러리 이미지가 이상하네요 ^^ 정보

저장된 갤러리 이미지가 이상하네요 ^^

본문

안녕하세요 오랜만에 문의를 하게 되네요
다른게 아니라 갤러리 게시판에서 이미지를 등록하면
썸네일 이미지, view이미지는 정상적으로 보이는대
이상하게 등록된 이미지가 256color? 도 안되는거 같네요...
혹시 몰라서 write_update.skin.php 파일의 내용도 한번 올려봅니다 -ㅁ-;;

wirte_update.skin.php
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

$board_skin_path = $cb_gallery_skin_path;

include_once("$board_skin_path/skin.lib.php");

list($img_width, $img_height) = explode("x", $board[bo_1]);
list($img2_width, $img2_height) = explode("x", $board[bo_2]);
$img_quality = 100;

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

@mkdir("$thumb_path", 0707);

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)) {
        $thumb_file = "{$thumb_path}/{$wr_id}";
        $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;
        if ($size[0] > $size[1]) {
            $rate = $board[bo_1] / $size[0];
            $height = (int)($size[1] * $rate);
            $img_width = $board[bo_1];
            $img_height = $height;
        } else {
            $rate = $board[bo_1] / $size[1];
            $width = (int)($size[0] * $rate);
            $img_width = $width;
            $img_height = $board[bo_1];
        }
        createThumb2($img_width, $img_height, $file, $thumb_file, $member[mb_id]);
       
        $thumb_file = "{$thumb_path}/{$wr_id}_{$img2_width}x{$img2_height}";
        createThumb($img2_width, $img2_height, $file, $thumb_file);

        $sql = " update $write_table set wr_10 = '$exif[Model]' where wr_id = '$wr_id' ";
        sql_query($sql);
    }
}

$sql2=" select * from $g4[board_file_table] where  bo_table = '$bo_table' and wr_id = '$wr_id' order by bf_no asc";
$results2 = sql_query($sql2);
for ($d=0; $row2=sql_fetch_array($results2); $d++)  { //~~~~~~~~~~~~~~~~~~~~~~~~~~~

if ($_FILES[bf_file][name][$d]) {
$file = $data_path .'/'. $row2[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($data_path.'/'.$row2[bf_file]);
$dst = imagecreatetruecolor($board[bo_1], $height);
imagecopyresampled($dst, $src, 0, 0, 0, 0, $board[bo_1], $height, $size[0], $size[1]);
// imagepng($dst, $data_path.'/'.$row2[bf_file], $board[bo_2]);
//이부분이 png 압축방식이어서 이미지 커졌나 봅니다.
//아래처럼 하니 줄어드는 것을 확실히 느껴집니다....^^   
imagejpeg($dst, $data_path.'/'.$row2[bf_file], $board[bo_9]);
chmod($data_path.'/'.$row2[bf_file], 0606);
//---------->madem님이 알려주신 부분입니다.^^
$bf_size = @filesize(addslashes($file));
$sql = " update $g4[board_file_table]
set bf_filesize = '$bf_size', bf_exif = '$temp_exif'
where  bo_table = '$bo_table' and wr_id = '$wr_id'  ";
sql_query($sql);
//---------->madem님이 알려주신 부분입니다.^^
}
}
}
?>
추천
0

댓글 전체

$sql2=" select * from ~~~
위 부분뒤로 주석처리 해놓으니 정상적으로 이미지가 등록이 되네요 -ㅁ-;;
아마 전에 제가 따로 추가했던 부분인거 같기도 한대 이상한걸 붙여나 보네여 에혀 ㅠㅠ
불당님께 또다시 폐만 -ㅂ-
전체 3,524 |RSS
그누4 플러그인 내용 검색

회원로그인

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