미채택 완료
$size = @getimagesize($source_file); 파일 경로 문제??? source_file 에러 관련 질문
Copy
function photo_thumbnail($filename, $source_path, $target_path, $PHOTO_WIDTH, $PHOTO_HEIGHT, $is_create, $is_crop=false, $crop_mode='center', $is_sharpen=false, $um_value='80/0.5/3'){ global $g5; if(!$PHOTO_WIDTH && !$PHOTO_HEIGHT) return; $source_file = "$source_path/$filename"; echo $source_file; $size = @getimagesize($source_file);// if($size[2] < 1 || $size[2] > 3) // gif, jpg, png 에 대해서만 적용// return; print_r($size); echo "size[0] : ".$size[0]; echo "size[1] : ".$size[1]; echo "size[2] : ".$size[2]; echo "size[3] : ".$size[3]; echo "size[4] : ".$size[4]; echo "size[5] : ".$size[5];
$size = @getimagesize($source_file);
getimagesize를 가져오려고 하는데
$source_file을 에코로 뿌려보니 파일 경로는 제대로 들어가 있는데
변수로 $source_file을 넣으면 제대로 읽어오질 못합니다...
그래서 다른 밑에 코드부터 주르륵 새네요..
$source_file에 상대경로로 파일주소를 넣어보니;; 제대로 읽어옵니다..
어떻게 해야 하는지요??
개발강좌를 아무리 봐도.. 이 부분은 이해가 안되네요 ㅠㅠ
답변 2개
2017-08-21 (월) 09:25:14
php 도 디버깅 툴이 절실하네요 ^^
2017-08-21 (월) 09:17:29
하아.. 이것도 알아서 해결했습니다...
위에서 $source_file 에 들어가는 $file_path 에 경로가 G5_DATA_URL로 들어가 있었네요;;
G5_DATA_PATH 절대경로로 바꿔서 해결했습니다.
저랑 같은 실수 안하시길..^^;;
답변을 작성하려면 로그인이 필요합니다.