핸드폰으로 찍은 사진을 갤러리에 올릴 때 본문에 사진은 잘 보여지지만
리스트에는 썸네일이 표시되지 않고 그 위에
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg, libjpeg: recoverable error: Corrupt JPEG data: 143 extraneous bytes before marker 0xd9 in /home/hosting_users/도메인명/www/skin/board/gallery/skin.lib.php on line 79
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: '../data/file/bb_photo/2952592070_KPozwsHd_2012-06-19_19.21.20.jpg' is not a valid JPEG file in /home/hosting_users/도메인명/www/skin/board/gallery/skin.lib.php on line 79
이런 에러메세지가 출력됩니다.
딱히 모바일 전용 홈페이지가 있는것도 아니고 하나의 웹페이지를 사용하고 있습니다.
웹상에서 업로드시 정상적으로 썸네일이 생성되고 출력되는데
핸드폰으로 업로드한 사진은 썸네일 생성이 안되고 에러메세지가 뜨네요.
해당 갤러리의 skin.lib.php 본문입니다.
------------------------------------------------------------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!function_exists("makeThumbs")) {
function makeThumbs($oriPath, $oriFileName, $thmWidth="", $thmHeight="", $thmAlt="") {
global $g4, $board_skin_path;
$errorFilePrt = "<img src='$board_skin_path/img/noimage.gif' border=0 title='이미지 없음'>";
$oriFile = $oriPath . "/" . $oriFileName;
if (is_file($oriFile) == false) return $errorFilePrt; // 원본 부재
$thmPath = $oriPath . "/thumbs";
$thmFile = $thmPath . "/" . $oriFileName;
$oriSize = getimagesize($oriFile);
$oriWidth = $oriSize[0];
$oriHeight = $oriSize[1];
$oriType = $oriSize[2];
if ($oriType > 3) return $errorFilePrt; // 원본 이미지 타입 오류
$oriRate = $oriWidth / $oriHeight;
if ($thmWidth == "" && $thmHeight == "") return $errorFilePrt; // 썸네일 사이즈 미지정
if ($thmWidth == "") $thmWidth = $thmHeight * $oriRate;
if ($thmHeight == "") $thmHeight = $thmWidth / $oriRate;
$widthRate = $thmWidth / $oriWidth;
$heightRate = $thmHeight / $oriHeight;
$oriFilePrt = "<img src=\"{$oriFile}\" width=\"{$oriWidth}\" height=\"{$oriHeight}\" border=\"0\" alt=\"{$thmAlt}\" />";
if ($widthRate >= 1 && $heightRate >= 1) { // 리사이징 불필요
return $oriFilePrt;
}
if (file_exists($thmFile)) { // 썸네일 유무
$fp = fopen($thmFile, "r");
$fstat = fstat($fp);
$thmFileTime = $fstat['ctime'];
fclose($fp);
$fp = fopen($oriFile, "r");
$fstat = fstat($fp);
$oriFileTime = $fstat['ctime'];
fclose($fp);
if ($thmFileTime > $oriFileTime) { // 썸네일 갱신 불필요
$thmSize = getimagesize($thmFile);
$thmFilePrt = "<img src=\"{$thmFile}\" width=\"{$thmSize[0]}\" height=\"{$thmSize[1]}\" border=\"0\" alt=\"{$thmAlt}\" />";
} else {
@unlink($thmFile);
}
}
@mkdir($thmPath);
@chmod($thmPath, 0707);
if ($widthRate < $heightRate) {
$tempWidth = (int)($oriWidth * $heightRate);
$tempHeight = $thmHeight;
} else {
$tempWidth = $thmWidth;
$tempHeight = (int)($oriHeight * $widthRate);
}
if ($tempWidth == "") $tempWidth = $thmWidth;
if ($tempHeight == "") $tempHeight = $thmHeight;
switch($oriType) {
case(1) :
if(function_exists('imagecreateFromGif')) $tempImage = imagecreateFromGif($oriFile);
break;
case(2) :
if(function_exists('imagecreateFromJpeg')) $tempImage = imagecreateFromJpeg($oriFile); <--79번 라인
break;
case(3) :
if(function_exists('imagecreateFromPng')) $tempImage = imagecreateFromPng($oriFile);
break;
case(4) :
if(function_exists('imagecreateFromBmp')) $tempImage = imagecreateFromBmp($oriFile);
break;
}
if ($tempImage) {
if (function_exists('imagecreatetruecolor')) {
$tempCanvas = imagecreatetruecolor($thmWidth, $thmHeight);
} else {
$tempCanvas = imagecreate($thmWidth, $thmHeight);
}
if (function_exists('imagecopyresampled')) {
imagecopyresampled($tempCanvas, $tempImage, 0, 0, 0, 0, $tempWidth, $tempHeight, ImageSX($tempImage), ImageSY($tempImage));
} else {
imagecopyresized($tempCanvas, $tempImage, 0, 0, 0, 0, $tempWidth, $tempHeight, ImageSX($tempImage), ImageSY($tempImage));
}
ImageDestroy($tempImage);
ImageJpeg($tempCanvas, $thmFile, 100);
ImageDestroy($tempCanvas);
unset($tempImage, $tempCanvas);
}
$thmFilePrt = "<img src=\"{$thmFile}\" width=\"{$thmWidth}\" height=\"{$thmHeight}\" border=\"0\" alt=\"{$thmAlt}\" />";
return $thmFilePrt;
}
}
?>
----------------------------------------------------------------------------------------
그누보드는 4.36.02 버전으로 업데이트했으며
현재 쓰고 있는 갤러리는 예전에 스킨을 다운받아 사용중입니다.
워낙 초보라 겨우 찾아서 붙여넣는 정도의 실력입니다.
번거로우시겠지만 자세한 수정 내용 부탁드립니다 ㅠㅠ;;
리스트에는 썸네일이 표시되지 않고 그 위에
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg, libjpeg: recoverable error: Corrupt JPEG data: 143 extraneous bytes before marker 0xd9 in /home/hosting_users/도메인명/www/skin/board/gallery/skin.lib.php on line 79
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: '../data/file/bb_photo/2952592070_KPozwsHd_2012-06-19_19.21.20.jpg' is not a valid JPEG file in /home/hosting_users/도메인명/www/skin/board/gallery/skin.lib.php on line 79
이런 에러메세지가 출력됩니다.
딱히 모바일 전용 홈페이지가 있는것도 아니고 하나의 웹페이지를 사용하고 있습니다.
웹상에서 업로드시 정상적으로 썸네일이 생성되고 출력되는데
핸드폰으로 업로드한 사진은 썸네일 생성이 안되고 에러메세지가 뜨네요.
해당 갤러리의 skin.lib.php 본문입니다.
------------------------------------------------------------------------------------
<?
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
if (!function_exists("makeThumbs")) {
function makeThumbs($oriPath, $oriFileName, $thmWidth="", $thmHeight="", $thmAlt="") {
global $g4, $board_skin_path;
$errorFilePrt = "<img src='$board_skin_path/img/noimage.gif' border=0 title='이미지 없음'>";
$oriFile = $oriPath . "/" . $oriFileName;
if (is_file($oriFile) == false) return $errorFilePrt; // 원본 부재
$thmPath = $oriPath . "/thumbs";
$thmFile = $thmPath . "/" . $oriFileName;
$oriSize = getimagesize($oriFile);
$oriWidth = $oriSize[0];
$oriHeight = $oriSize[1];
$oriType = $oriSize[2];
if ($oriType > 3) return $errorFilePrt; // 원본 이미지 타입 오류
$oriRate = $oriWidth / $oriHeight;
if ($thmWidth == "" && $thmHeight == "") return $errorFilePrt; // 썸네일 사이즈 미지정
if ($thmWidth == "") $thmWidth = $thmHeight * $oriRate;
if ($thmHeight == "") $thmHeight = $thmWidth / $oriRate;
$widthRate = $thmWidth / $oriWidth;
$heightRate = $thmHeight / $oriHeight;
$oriFilePrt = "<img src=\"{$oriFile}\" width=\"{$oriWidth}\" height=\"{$oriHeight}\" border=\"0\" alt=\"{$thmAlt}\" />";
if ($widthRate >= 1 && $heightRate >= 1) { // 리사이징 불필요
return $oriFilePrt;
}
if (file_exists($thmFile)) { // 썸네일 유무
$fp = fopen($thmFile, "r");
$fstat = fstat($fp);
$thmFileTime = $fstat['ctime'];
fclose($fp);
$fp = fopen($oriFile, "r");
$fstat = fstat($fp);
$oriFileTime = $fstat['ctime'];
fclose($fp);
if ($thmFileTime > $oriFileTime) { // 썸네일 갱신 불필요
$thmSize = getimagesize($thmFile);
$thmFilePrt = "<img src=\"{$thmFile}\" width=\"{$thmSize[0]}\" height=\"{$thmSize[1]}\" border=\"0\" alt=\"{$thmAlt}\" />";
} else {
@unlink($thmFile);
}
}
@mkdir($thmPath);
@chmod($thmPath, 0707);
if ($widthRate < $heightRate) {
$tempWidth = (int)($oriWidth * $heightRate);
$tempHeight = $thmHeight;
} else {
$tempWidth = $thmWidth;
$tempHeight = (int)($oriHeight * $widthRate);
}
if ($tempWidth == "") $tempWidth = $thmWidth;
if ($tempHeight == "") $tempHeight = $thmHeight;
switch($oriType) {
case(1) :
if(function_exists('imagecreateFromGif')) $tempImage = imagecreateFromGif($oriFile);
break;
case(2) :
if(function_exists('imagecreateFromJpeg')) $tempImage = imagecreateFromJpeg($oriFile); <--79번 라인
break;
case(3) :
if(function_exists('imagecreateFromPng')) $tempImage = imagecreateFromPng($oriFile);
break;
case(4) :
if(function_exists('imagecreateFromBmp')) $tempImage = imagecreateFromBmp($oriFile);
break;
}
if ($tempImage) {
if (function_exists('imagecreatetruecolor')) {
$tempCanvas = imagecreatetruecolor($thmWidth, $thmHeight);
} else {
$tempCanvas = imagecreate($thmWidth, $thmHeight);
}
if (function_exists('imagecopyresampled')) {
imagecopyresampled($tempCanvas, $tempImage, 0, 0, 0, 0, $tempWidth, $tempHeight, ImageSX($tempImage), ImageSY($tempImage));
} else {
imagecopyresized($tempCanvas, $tempImage, 0, 0, 0, 0, $tempWidth, $tempHeight, ImageSX($tempImage), ImageSY($tempImage));
}
ImageDestroy($tempImage);
ImageJpeg($tempCanvas, $thmFile, 100);
ImageDestroy($tempCanvas);
unset($tempImage, $tempCanvas);
}
$thmFilePrt = "<img src=\"{$thmFile}\" width=\"{$thmWidth}\" height=\"{$thmHeight}\" border=\"0\" alt=\"{$thmAlt}\" />";
return $thmFilePrt;
}
}
?>
----------------------------------------------------------------------------------------
그누보드는 4.36.02 버전으로 업데이트했으며
현재 쓰고 있는 갤러리는 예전에 스킨을 다운받아 사용중입니다.
워낙 초보라 겨우 찾아서 붙여넣는 정도의 실력입니다.
번거로우시겠지만 자세한 수정 내용 부탁드립니다 ㅠㅠ;;
댓글 2개
게시글 목록
| 번호 | 제목 |
|---|---|
| 284508 | |
| 284499 | |
| 284492 | |
| 284490 | |
| 284484 | |
| 284481 | |
| 284478 | |
| 284476 | |
| 284474 | |
| 284472 | |
| 284470 | |
| 284458 | |
| 284457 | |
| 284454 | |
| 284453 | |
| 284447 | |
| 284446 | |
| 284444 | |
| 284441 | |
| 284440 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기