테스트 사이트 - 개발 중인 베타 버전입니다

g4 갤러리 오류 채택완료

인터웹 4년 전 조회 2,116

http://paulkid.co.kr/bbs/board.php?bo_table=g04_02">http://paulkid.co.kr/bbs/board.php?bo_table=g04_02

 

Warning: getimagesize(../data/file/g04_02/598222043_StQkLy3a_KakaoTalk_20210522_162149517_01.jpg) [http://paulkid.co.kr/bbs/function.getimagesize">function.getimagesize]: failed to open stream: Permission denied in /web/home/paulkid/html/skin/board/g011/skin.lib.php on line 17

Warning: Division by zero in /web/home/paulkid/html/skin/board/g011/skin.lib.php on line 24

Warning: Division by zero in /web/home/paulkid/html/skin/board/g011/skin.lib.php on line 31

Warning: Division by zero in /web/home/paulkid/html/skin/board/g011/skin.lib.php on line 32

Warning: fopen(../data/file/g04_02/598222043_StQkLy3a_KakaoTalk_20210522_162149517_01.jpg) [http://paulkid.co.kr/bbs/function.fopen">function.fopen]: failed to open stream: Permission denied in /web/home/paulkid/html/skin/board/g011/skin.lib.php on line 45

Warning: fstat(): supplied argument is not a valid stream resource in /web/home/paulkid/html/skin/board/g011/skin.lib.php on line 46

Warning: fclose(): supplied argument is not a valid stream resource in /web/home/paulkid/html/skin/board/g011/skin.lib.php on line 48

Warning: getimagesize(../data/file/g04_02/598222043_CZQEHAKX_KakaoTalk_20210522_154504063_04.jpg) [http://paulkid.co.kr/bbs/function.getimagesize">function.getimagesize]: failed to open stream: Permission denied in /web/home/paulkid/html/skin/board/g011/skin.lib.php on line 17

Warning: Division by zero in /web/home/paulkid/html/skin/board/g011/skin.lib.php on line 24

Warning: Division by zero in /web/home/paulkid/html/skin/board/g011/skin.lib.php on line 31

Warning: Division by zero in /web/home/paulkid/html/skin/board/g011/skin.lib.php on line 32

Warning: fopen(../data/file/g04_02/598222043_CZQEHAKX_KakaoTalk_20210522_154504063_04.jpg) [http://paulkid.co.kr/bbs/function.fopen">function.fopen]: failed to open stream: Permission denied in /web/home/paulkid/html/skin/board/g011/skin.lib.php on line 45

Warning: fstat(): supplied argument is not a valid stream resource in /web/home/paulkid/html/skin/board/g011/skin.lib.php on line 46

Warning: fclose(): supplied argument is not a valid stream resource in /web/home/paulkid/html/skin/board/g011/skin.lib.php on line 48

 

 

skin/board/g011/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\" alt=\"이미지 없음\" />";

  $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 (is_dir($oriPath . "/thumbs/")) {
    $array1 = $array2 = array();
    if ($dh = opendir($oriPath . "/thumbs/")) {
     while (($file = readdir($dh)) !== false) {
      $array1[] = $file;
     }
     closedir($dh);
    }
    if ($dh = opendir($oriPath . "/")) {
     while (($file = readdir($dh)) !== false) {
      $array2[] = $file;
     }
     closedir($dh);
    }
    $array_diff = array_diff($array1, $array2);
    foreach ($array_diff as $k => $v) {
     if (is_file($oriPath . "/thumbs/" . $v)) @unlink($oriPath . "/thumbs/" . $v);
    }
   }

   $thmFileSize = getimagesize($thmFile);

   if ($thmWidth == $thmFileSize[0] && $thmHeight == $thmFileSize[1]) { // 썸네일 갱신 불필요
    if ($thmFileTime > $oriFileTime) {
     $thmSize = getimagesize($thmFile);
     $thmFilePrt = "<img src=\"".$thmFile."\" width=\"".$thmSize[0]."\" height=\"".$thmSize[1]."\" border=\"0\" alt=\"".$thmAlt."\" />";
     return $thmFilePrt;
    }
   }

  }

  @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);
    break;
   case(3) :
    if(function_exists('imagecreateFromPng')) $tempImage = imagecreateFromPng($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;
 }
}
?>

 

 

 

 

댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트

저 오류가 뜨기전에 혹시 파일 업로드하는쪽을 수정하거나 한게 있나요?

 

지금 제일 상단에 권한 문제가 발생했으니 data의 하위 폴더들의 권한을 한번 바꿔보세요.

 

하나씩 잡아가는 방법 밖에 없을듯 하네요

 

 

로그인 후 평가할 수 있습니다

답변에 대한 댓글 2개

인터웹
4년 전
데이타가 호스팅업체제공대비 7베가 있어서 로그인이 안되어 ftp에서 사진들을 많이 삭제했습니다
인터웹
4년 전
해결했습니다. 해당 사진을 ftp에서 삭제했더니 정상으로 돌아왔네요

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인