我在Android中使用Glide 3.8.0来预取图像:
Glide.with(context)
.load(imageUrl)
.diskCacheStrategy(DiskCacheStrategy.ALL)
.preload();
有了这个,我看到显示分辨率的日志[-2147483648x-2147483648]
V/Engine: Started new load in 1.75375ms, key: EngineKey{https://....com/uu/api/res/1.2/15USE5cHzsN75A26JngW_Q--/YXBwaWQ9eXRhY2h5b247Zmk9c3RyaW07aD0zNjA7dz02NDA7/http://....com/c026d208260f1b9d6880604661897d28+com.bumptech.glide.signature.EmptySignature@1341382+[-2147483648x-2147483648]+''+'ImageVideoBitmapDecoder.com.bumptech.glide.load.resource.bitmap'+''+'BitmapEncoder.com.bumptech.glide.load.resource.bitmap'+'GifBitmapWrapperDrawableTranscoder.com.bumptech.glide.load.resource.transcode'+''}
加载实际图像视图时,查找的大小不同[1224x1020]:
V/Engine: Started new load in 0.45197899999999996ms, key: EngineKey{https://....com/uu/api/res/1.2/15USE5cHzsN75A26JngW_Q--/YXBwaWQ9eXRhY2h5b247Zmk9c3RyaW07aD0zNjA7dz02NDA7/http://....com/c026d208260f1b9d6880604661897d28+com.bumptech.glide.signature.EmptySignature@1341382+[1224x1020]+''+'ImageVideoBitmapDecoder.com.bumptech.glide.load.resource.bitmap'+''+'BitmapEncoder.com.bumptech.glide.load.resource.bitmap'+'GifBitmapWrapperDrawableTranscoder.com.bumptech.glide.load.resource.transcode'+''}
如果我不想提前考虑尺寸,我该如何缓存呢?