양

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

// 파일을 업로드 했다면
 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와 관련된 팁을 여러분들과 함께 공유하세요. 나누면 즐거움이 커집니다.

+
제목 글쓴이 날짜 조회
08-01-31 조회 2,768
08-01-31 조회 5,480
08-01-31 조회 3,623
08-01-30 조회 5,253
08-01-29 조회 5,647
08-01-28 조회 4,591
08-01-24 조회 3,966
08-01-24 조회 3,759
08-01-24 조회 4,275
08-01-22 조회 4,268
08-01-20 조회 9,648
08-01-19 조회 1.2만
08-01-19 조회 3,831
08-01-19 조회 3,391
08-01-19 조회 4,525
08-01-18 조회 8,211
08-01-18 조회 3,356
08-01-17 조회 6,935
08-01-15 조회 4,018
08-01-15 조회 3,035