private File getImageFileInDiscCache() {
   DiscCacheAware discCache = configuration.discCache;
   File imageFile = discCache.get(uri);
   File cacheDir = imageFile.getParentFile();
   if (cacheDir == null || (!cacheDir.exists() && !cacheDir.mkdirs())) {
     imageFile = configuration.reserveDiscCache.get(uri);
     cacheDir = imageFile.getParentFile();
     if (cacheDir != null && !cacheDir.exists()) {
       cacheDir.mkdirs();
     }
   }
   return imageFile;
 }
  private Bitmap tryLoadBitmap() {
    DiscCacheAware discCache = configuration.discCache;
    File imageFile = discCache.get(uri);

    Bitmap bitmap = null;
    try {
      // Try to load image from disc cache
      if (imageFile.exists()) {
        log(LOG_LOAD_IMAGE_FROM_DISC_CACHE, memoryCacheKey);

        Bitmap b = decodeImage(imageFile.toURI());
        if (b != null) {
          return b;
        }
      }

      // Load image from Web
      log(LOG_LOAD_IMAGE_FROM_INTERNET, memoryCacheKey);

      URI imageUriForDecoding;
      if (options.isCacheOnDisc()) {
        log(LOG_CACHE_IMAGE_ON_DISC, memoryCacheKey);

        saveImageOnDisc(imageFile);
        discCache.put(uri, imageFile);
        imageUriForDecoding = imageFile.toURI();
      } else {
        imageUriForDecoding = new URI(uri);
      }

      bitmap = decodeImage(imageUriForDecoding);
      if (bitmap == null) {
        fireImageLoadingFailedEvent(FailReason.IO_ERROR);
      }
    } catch (IOException e) {
      L.e(e);
      fireImageLoadingFailedEvent(FailReason.IO_ERROR);
      if (imageFile.exists()) {
        imageFile.delete();
      }
    } catch (OutOfMemoryError e) {
      L.e(e);
      fireImageLoadingFailedEvent(FailReason.OUT_OF_MEMORY);
    } catch (Throwable e) {
      L.e(e);
      fireImageLoadingFailedEvent(FailReason.UNKNOWN);
    }
    return bitmap;
  }