【发布时间】:2013-09-28 13:23:57
【问题描述】:
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。
我也尝试设置inJustDecodeBounds = false,但decodeFile 方法仍然返回null。
当我将 imageFilePath 设置为本地图像文件时,它对来自普通 http 网站的文件再次不起作用。
对于那些想知道如何连接到 FTP 服务器的人,它已成功连接和验证,甚至我也正确地使用 FTPClient.listFiles() 和 FTPClient.listNames() 获取所有图像文件及其名称。
【问题讨论】:
标签: android ftp decode ftp-client bitmapfactory