aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaneren2005 <daneren2005@gmail.com>2012-12-13 14:41:31 -0800
committerdaneren2005 <daneren2005@gmail.com>2012-12-13 14:41:31 -0800
commit303e4cacd39d8249c9270d6eb51f9d1187fb0a1a (patch)
tree29ab051e733d300fd275ec02eac5baaa83a6a808
parentbcae7366c015165e9afbea9d0d3ded0f6e47524d (diff)
downloaddsub-303e4cacd39d8249c9270d6eb51f9d1187fb0a1a.tar.gz
dsub-303e4cacd39d8249c9270d6eb51f9d1187fb0a1a.tar.bz2
dsub-303e4cacd39d8249c9270d6eb51f9d1187fb0a1a.zip
Fix for trying to pass 0 as bitmap width/height
-rw-r--r--subsonic-android/src/github/daneren2005/dsub/util/ImageLoader.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/util/ImageLoader.java b/subsonic-android/src/github/daneren2005/dsub/util/ImageLoader.java
index 8c037468..dcf4b389 100644
--- a/subsonic-android/src/github/daneren2005/dsub/util/ImageLoader.java
+++ b/subsonic-android/src/github/daneren2005/dsub/util/ImageLoader.java
@@ -147,7 +147,11 @@ public class ImageLoader implements Runnable {
Drawable existingDrawable = imageView.getDrawable();
if (existingDrawable == null) {
- Bitmap emptyImage = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
+ if(drawable.getIntrinsicWidth() > 0 && drawable.getIntrinsicHeight() > 0) {
+ Bitmap emptyImage = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
+ } else {
+ Bitmap emptyImage = Bitmap.createBitmap(imageSizeDefault, imageSizeDefault, Bitmap.Config.ARGB_8888);
+ }
existingDrawable = new BitmapDrawable(emptyImage);
}