서버 이전시 썸네일에서 에러 출력시

// 파일을 업로드 했다면
 if (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);

        unlink($file);
        // 계산된 썸네일 이미지의 높이가 설정된 이미지의 높이보다 작다면
        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, $file, $img_quality);
        chmod($file, 0606);
}


warning: getimagesize(): PNG file corrupted by ASCII conversion in /home/wteastuk/public_html/new/includes/theme.inc on line 519.
경고의 메세지를 출력합니다. 이유는 간단하죠

ftp다운 혹은 업로드시 썸네일 파일은 바이너리로 해야 합니다.

참고
http://drupal.org/node/68799

Thanks for the tip, but

Talib - June 13, 2006 - 20:44

Thanks for the tip, but although I tried, I couldn't rectify it by deleting the image and uploading it again via binay mode (using Smart FTP).

|

댓글 1개

좋은 정보 감사합니다 ^^
댓글을 작성하시려면 로그인이 필요합니다.

그누4 팁자료실

그누보드4와 관련된 팁을 여러분들과 함께 공유하세요. 나누면 즐거움이 커집니다.

+
제목 글쓴이 날짜 조회
18년 전 조회 4,428
18년 전 조회 3,796
18년 전 조회 3,578
18년 전 조회 4,127
18년 전 조회 4,117
18년 전 조회 9,457
18년 전 조회 1.2만
18년 전 조회 3,640
18년 전 조회 3,230
18년 전 조회 4,347
18년 전 조회 8,018
18년 전 조회 3,188
18년 전 조회 6,745
18년 전 조회 3,852
18년 전 조회 2,871
18년 전 조회 3,161
18년 전 조회 2,948
18년 전 조회 4,238
18년 전 조회 1.9만
18년 전 조회 2,591