내 이미지의 크기를 가져 오려면 getimagesize()를 사용하고 있습니다. 내가 오류에 직면 MA 하위 디렉토리와 파일 이름을 전달하고 때 나는 내 하위 디렉토리에 이미지가 : 내가getimagezise 파일 이름 변경 오류
을 전달할 때 대신의<?PHP
function resize($img,$max_w){
$max_h=$max_w;
list($img_w,$img_h) = getimagesize($img);
$f = min($max_w/$img_w, $max_h/$img_h, 1);
$w = round($f * $img_w);
$h = round($f * $img_h);
return array($w,$h);
}
$filename="user_img/"."1256115556.jpg";
$resize=resize($filename,667);
$w=$resize[0];
$h=$resize[1];
?>
: 여기
내 코드입니다There is no such file or directory
$filename="1256115556.jpg";
파일이 내 기본 디렉토리의 기능을 완벽하게 실행 중입니다. 그래서 제발 도와주세요, 하위 디렉토리와 파일을 전달하는 방법.
스크립트의 끝에 echo realpath ($ filename);를 추가하고 출력을 게시하십시오. 파일이 실제로 있는지 확인하십시오. – svens