private Resource<T> loadFromCache(Key key) throws IOException {
        File cacheFile = diskCacheProvider.getDiskCache().get(key);
        if (cacheFile == null) {
            return null;
        }

        Resource<T> result = null;
        try {
            result = loadProvider.getCacheDecoder().decode(cacheFile, width, height);
        } finally {
            if (result == null) {
                diskCacheProvider.getDiskCache().delete(key);
            }
        }
        return result;
    }
Returns a transformed and transcoded resource decoded from source data, or null if no source data could be
obtained or no resource could be decoded.

<p>
    Depending on the {@link DiskCacheStrategy} used, source data is either decoded
    directly or first written to the disk cache and then decoded from the disk cache.
</p>

@throws Exception
core/src/main/java/com/bumptech/glide/load/engine/DecodeJob.java