Skip to content

Commit

Permalink
Don't use a special downsampler in ImageManager
Browse files Browse the repository at this point in the history
It doesn't work for non exact sizing.
  • Loading branch information
sjudd committed Mar 15, 2014
1 parent 680eb4d commit f8a7681
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions library/src/com/bumptech/glide/resize/ImageManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,6 @@ public class ImageManager {
private final DiskCache diskCache;
private final SafeKeyGenerator safeKeyGenerator = new SafeKeyGenerator();

//special downsampler that doesn't check exif, and assumes inWidth and inHeight == outWidth and outHeight so it
//doesn't need to read the image header for size information
private static Downsampler DISK_CACHE_DOWNSAMPLER = new Downsampler() {

@Override
public Bitmap downsample(RecyclableBufferedInputStream bis, BitmapFactory.Options options, BitmapPool pool,
int outWidth, int outHeight) {
return downsampleWithSize(bis, options, pool, outWidth, outHeight, 1);
}

@Override
protected int getSampleSize(int inWidth, int inHeight, int outWidth, int outHeight) {
return 0;
}
};


/**
* Get the maximum safe memory cache size for this particular device based on the # of mb allocated to each app.
* This is a conservative estimate that has been safe for 2.2+ devices consistently. It is probably rather small
Expand Down Expand Up @@ -620,7 +603,7 @@ private Bitmap getFromDiskCache(String key) {
Bitmap result = null;
final InputStream is = diskCache.get(key);
if (is != null) {
result = resizer.load(is, width, height, DISK_CACHE_DOWNSAMPLER);
result = resizer.load(is, width, height, Downsampler.NONE);
if (result == null) {
diskCache.delete(key); //the image must have been corrupted
}
Expand Down

0 comments on commit f8a7681

Please sign in to comment.