Issue 1:
Hi! I'm using Glide in my project.

Like some people, I had a problem，How can I fetch a loaded image file from cache?

I read the Glide api carefully ,and found downloadOnly ,but it can not solve my problem,

Only need to get the picture cache, if not loaded do not need to download.

And then I read the Glide api again,found the EngineKey is key。

finally，I replace the EngineKey.java,

public class EngineKey implements Key {

private static final String EMPTY_LOG_STRING = "";
private String id;
private Key signature;
private String stringKey;
private int hashCode;
private Key originalKey;

public EngineKey(String id, Key signature, int width, int height, ResourceDecoder cacheDecoder,
ResourceDecoder sourceDecoder, Transformation transformation, ResourceEncoder encoder,
ResourceTranscoder transcoder, Encoder sourceEncoder){
this(id,signature);
}

public EngineKey(String id, Key signature) {
this.id = id;
this.signature = signature;
}

public EngineKey(String id) {
this(id, EmptySignature.obtain());
}

public Key getOriginalKey() {
if (originalKey == null) {
originalKey = new OriginalKey(id, signature);
}
return originalKey;
}

@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}

EngineKey engineKey = (EngineKey) o;

if (!id.equals(engineKey.id)) {
return false;
} else if (!signature.equals(engineKey.signature)) {
return false;
}
return true;
}

@Override
public int hashCode() {
if (hashCode == 0) {
hashCode = id.hashCode();
hashCode = 31 * hashCode + signature.hashCode();
}
return hashCode;
}

@Override
public String toString() {
if (stringKey == null) {
stringKey = new StringBuilder()
.append("EngineKey{")
.append(id)
.append('+')
.append(signature)
.append('}')
.toString();
}
return stringKey;
}

@Override
public void updateDiskCacheKey(MessageDigest messageDigest) throws UnsupportedEncodingException {
signature.updateDiskCacheKey(messageDigest);
messageDigest.update(id.getBytes(STRING_CHARSET_NAME));
}
}

use like that:

String url = "http://xxxxxx";
ExternalCacheDiskCacheFactory factory = new ExternalCacheDiskCacheFactory(activity);
File file = factory.build().get(new EngineKey(url));

Issue 2:
Hi,now I want to migrate my app from universalimageloader to glide. But I have a question is that I can‘t judge a image is already cached in disk。

There is my case:

There are many different resources and different URL for one image. Different network environments load different resources。For example，When I was in the 3G network，load the low quality image resource and the URL is "http://www.xxxxx_3g.png"。When I was in the WIFI network，load the high quality image resource and the URL is "http://www.yyyyyy_wifi.png"，There are two different URLs。

BUT! When I was in the 3G network，check the high quality image resource first。If the high quality image resource is already cached, load the high quality image resource URL from disk cache. Otherwise load "http://www.xxxxx_3g.png"。

if (isCache("http://www.yyyyyy_wifi.png") {
Glide.with(...)
.load("http://www.yyyyyy_wifi.png")
.into(...);
} else {
Glide.with(...)
.load("http://www.xxxxx_3g.png")
.into(...);
}

public boolean isCache(String url) {
// what should I do ???
}

So,How can I judge the high quality image resource(URL is "http://www.yyyyyy_wifi.png") is already cached in disk synchronously?

Thank you very much。