서버 이전시 썸네일에서 에러 출력시 정보
서버 이전시 썸네일에서 에러 출력시
본문
// 파일을 업로드 했다면
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
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).
0
댓글 1개
