diff options
author | Scott Jackson <daneren2005@gmail.com> | 2014-09-09 06:03:53 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2014-09-09 06:03:53 -0700 |
commit | da3fcd84290e731aadcd23fa27817c52082132bb (patch) | |
tree | f383077a78a2dfce214807df83b79c4028be4583 /src | |
parent | d98b2adfd32c06ed527994388a5567478ba1b10c (diff) | |
download | dsub-da3fcd84290e731aadcd23fa27817c52082132bb.tar.gz dsub-da3fcd84290e731aadcd23fa27817c52082132bb.tar.bz2 dsub-da3fcd84290e731aadcd23fa27817c52082132bb.zip |
#296 Don't scale bitmap when less then or close to right size anyways
Diffstat (limited to 'src')
-rw-r--r-- | src/github/daneren2005/dsub/util/FileUtil.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/util/FileUtil.java b/src/github/daneren2005/dsub/util/FileUtil.java index 5aafe213..6246c2de 100644 --- a/src/github/daneren2005/dsub/util/FileUtil.java +++ b/src/github/daneren2005/dsub/util/FileUtil.java @@ -255,7 +255,12 @@ public class FileUtil { } } public static Bitmap getScaledBitmap(Bitmap bitmap, int size) { - return Bitmap.createScaledBitmap(bitmap, size, Util.getScaledHeight(bitmap, size), true); + // Don't waste time scaling if the difference is minor + if(bitmap.getWidth() < (size * 1.1)) { + return bitmap; + } else { + return Bitmap.createScaledBitmap(bitmap, size, Util.getScaledHeight(bitmap, size), true); + } } public static File getAlbumArtDirectory(Context context) { |