String imageFilePath = "ftp://hostname/dir/imagefilename.jpg";
BitmapFactory.Options options = new BitmapFactory.Options;
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(imageFilePath, options);
int height = options.outHeight;
int width = options.outWidth;
그러나 height
및 width
항상 0
있는 FTP 서버에서 이미지 파일 BitmapFactory.Options 0입니다.outWidth 및 outHeight는
또한 inJustDecodeBounds = false
을 설정하여 시도했지만 여전히 decodeFile
메서드는 null
을 반환합니다.
imageFilePath
을 로컬 이미지 파일로 설정하면 다시 작동하고 다시 은 http
웹 사이트의 파일에 대해을 처리하지 못했습니다.
FTP 서버에 연결하는 데 궁금한 사람들은 성공적으로 연결되고 인증되며 심지어는 FTPClient.listFiles()
및 FTPClient.listNames()
을 사용하여 모든 이미지 파일과 이름을 올바르게 가져옵니다.