aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2014-09-29 15:45:14 -0700
committerScott Jackson <daneren2005@gmail.com>2014-09-29 15:45:14 -0700
commitab46c5c1b7a490b4ab7ccb011da8c8872785db87 (patch)
tree99a72be84b414270807ebc41ee4ba957e6a730ea
parentd4dade3669a07f9651e437ec278535458716aa83 (diff)
downloaddsub-ab46c5c1b7a490b4ab7ccb011da8c8872785db87.tar.gz
dsub-ab46c5c1b7a490b4ab7ccb011da8c8872785db87.tar.bz2
dsub-ab46c5c1b7a490b4ab7ccb011da8c8872785db87.zip
Add method to override unscaling behavior
-rw-r--r--src/github/daneren2005/dsub/util/FileUtil.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/github/daneren2005/dsub/util/FileUtil.java b/src/github/daneren2005/dsub/util/FileUtil.java
index 9433043c..bf0f288b 100644
--- a/src/github/daneren2005/dsub/util/FileUtil.java
+++ b/src/github/daneren2005/dsub/util/FileUtil.java
@@ -257,9 +257,12 @@ public class FileUtil {
}
}
public static Bitmap getScaledBitmap(Bitmap bitmap, int size) {
+ return getScaledBitmap(bitmap, size, true);
+ }
+ public static Bitmap getScaledBitmap(Bitmap bitmap, int size, boolean allowUnscaled) {
// Don't waste time scaling if the difference is minor
// Large album arts still need to be scaled since displayed as is on now playing!
- if(size < 400 && bitmap.getWidth() < (size * 1.1)) {
+ if(allowUnscaled && size < 400 && bitmap.getWidth() < (size * 1.1)) {
return bitmap;
} else {
return Bitmap.createScaledBitmap(bitmap, size, Util.getScaledHeight(bitmap, size), true);