From 303e4cacd39d8249c9270d6eb51f9d1187fb0a1a Mon Sep 17 00:00:00 2001 From: daneren2005 Date: Thu, 13 Dec 2012 14:41:31 -0800 Subject: Fix for trying to pass 0 as bitmap width/height --- subsonic-android/src/github/daneren2005/dsub/util/ImageLoader.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); } -- cgit v1.2.3