public ImageDecodingInfo(String imageKey, String imageUri, String originalImageUri, ImageSize targetSize, ViewScaleType viewScaleType, ImageDownloader downloader, DisplayImageOptions displayOptions) { this.imageKey = imageKey; this.imageUri = imageUri; this.originalImageUri = originalImageUri; this.targetSize = targetSize; this.imageScaleType = displayOptions.getImageScaleType(); this.viewScaleType = viewScaleType; this.downloader = downloader; this.extraForDownloader = displayOptions.getExtraForDownloader(); considerExifParams = displayOptions.isConsiderExifParams(); decodingOptions = new Options(); copyOptions(displayOptions.getDecodingOptions(), decodingOptions); }
private boolean downloadImage() throws IOException { InputStream is = getDownloader().getStream(uri, options.getExtraForDownloader()); if (is == null) { L.e(ERROR_NO_IMAGE_STREAM, memoryCacheKey); return false; } else { try { return configuration.diskCache.save(uri, is, this); } finally { IoUtils.closeSilently(is); } } }
public ImageDecodingInfo(String imageKey, String imageUri, ImageSize targetSize, ViewScaleType viewScaleType, ImageDownloader downloader, DisplayImageOptions displayOptions) { this.imageKey = imageKey; this.imageUri = imageUri; this.targetSize = targetSize; this.imageScaleType = displayOptions.getImageScaleType(); this.viewScaleType = viewScaleType; this.downloader = downloader; this.extraForDownloader = displayOptions.getExtraForDownloader(); decodingOptions = new Options(); copyOptions(displayOptions.getDecodingOptions(), decodingOptions); }
private void downloadImage(File targetFile) throws IOException { InputStream is = getDownloader().getStream(uri, options.getExtraForDownloader()); try { OutputStream os = new BufferedOutputStream(new FileOutputStream(targetFile), BUFFER_SIZE); try { IoUtils.copyStream(is, os); } finally { IoUtils.closeSilently(os); } } finally { IoUtils.closeSilently(is); } }
public ImageDecodingInfo(String imageKey, String imageUri, String originalImageUri, ImageSize targetSize, ViewScaleType viewScaleType, ImageDownloader downloader, DisplayImageOptions displayOptions) { this.imageKey = imageKey; this.imageUri = imageUri; this.originalImageUri = originalImageUri; this.targetSize = targetSize; this.imageScaleType = displayOptions.getImageScaleType(); this.viewScaleType = viewScaleType; this.downloader = downloader; this.extraForDownloader = displayOptions.getExtraForDownloader(); considerExifParams = displayOptions.isConsiderExifParams(); decodingOptions = new Options(); copyOptions(displayOptions.getDecodingOptions(), decodingOptions); }
public ImageDecodingInfo(String imageKey, String imageUri, String originalImageUri, ImageSize targetSize, ViewScaleType viewScaleType, ImageDownloader downloader, DisplayImageOptions displayOptions) { this.imageKey = imageKey; this.imageUri = imageUri; this.originalImageUri = originalImageUri; this.targetSize = targetSize; this.imageScaleType = displayOptions.getImageScaleType(); this.viewScaleType = viewScaleType; this.downloader = downloader; this.extraForDownloader = displayOptions.getExtraForDownloader(); considerExifParams = displayOptions.isConsiderExifParams(); decodingOptions = new Options(); copyOptions(displayOptions.getDecodingOptions(), decodingOptions); }
public ImageDecodingInfo(String imageKey, String imageUri, String originalImageUri, ImageSize targetSize, ViewScaleType viewScaleType, ImageDownloader downloader, DisplayImageOptions displayOptions) { this.imageKey = imageKey; this.imageUri = imageUri; this.originalImageUri = originalImageUri; this.targetSize = targetSize; this.imageScaleType = displayOptions.getImageScaleType(); this.viewScaleType = viewScaleType; this.downloader = downloader; this.extraForDownloader = displayOptions.getExtraForDownloader(); considerExifParams = displayOptions.isConsiderExifParams(); decodingOptions = new Options(); copyOptions(displayOptions.getDecodingOptions(), decodingOptions); }
private boolean downloadImage() throws IOException { InputStream is = getDownloader().getStream(uri, options.getExtraForDownloader()); if (is == null) { L.e(ERROR_NO_IMAGE_STREAM, memoryCacheKey); return false; } else { try { return configuration.diskCache.save(uri, is, this); } finally { IoUtils.closeSilently(is); } } }
private boolean downloadImage() throws IOException { InputStream is = getDownloader().getStream(uri, options.getExtraForDownloader()); if (is == null) { L.e(ERROR_NO_IMAGE_STREAM, memoryCacheKey); return false; } else { try { return configuration.diskCache.save(uri, is, this); } finally { IoUtils.closeSilently(is); } } }
/** * 图片通过网络下载,并且下载成功之后 进行本地文件系统缓存 * @return 下载并且缓存本地文件系统成功返回 true,否则返回false * @throws IOException */ private boolean downloadImage() throws IOException { InputStream is = getDownloader().getStream(uri, options.getExtraForDownloader()); if (is == null) { L.e(ERROR_NO_IMAGE_STREAM, memoryCacheKey); return false; } else { try { //进行图片资源缓存到本地文件系统中 return configuration.diskCache.save(uri, is, this); } finally { IoUtils.closeSilently(is); } } }