title: android.support.v7.graphics.Palette width and height must be > 0
body: <p>I have some code using the new <code>Palette</code> class and I'm getting these crash reports on Crashlytics saying that the <code>width and height must be &gt; 0</code>. What is odd is that this is how I call the palette code:</p>
  
  <pre><code>if( bitmap == null || bitmap.getHeight() &lt;= 0 || bitmap.getWidth() &lt;= 0){
     //do something
  }else{
     Palette.Builder(bitmap).generate(new Palette.PaletteAsyncListener() {
  .....
  }
  </code></pre>
  
  <p>So I am just not sure how it is possible that the bitmap all of the sudden doesn't have the right height or width. I don't know which piece of my code the exception is coming from because the report only include stuff inside the palette class. </p>
  
  <p>Here is the exception:</p>
  
  <pre><code>java.lang.RuntimeException: An error occured while executing doInBackground()
         at android.os.AsyncTask$3.done(AsyncTask.java:300)
         at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355)
         at java.util.concurrent.FutureTask.setException(FutureTask.java:222)
         at java.util.concurrent.FutureTask.run(FutureTask.java:242)
         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
         at java.lang.Thread.run(Thread.java:818)
  Caused by: java.lang.IllegalArgumentException: width and height must be &gt; 0
         at android.graphics.Bitmap.createBitmap(Bitmap.java:815)
         at android.graphics.Bitmap.createBitmap(Bitmap.java:794)
         at android.graphics.Bitmap.createBitmap(Bitmap.java:725)
         at android.graphics.Bitmap.createScaledBitmap(Bitmap.java:601)
         at android.support.v7.graphics.Palette.scaleBitmapDown(Palette.java:282)
         at android.support.v7.graphics.Palette.access$100(Palette.java:67)
         at android.support.v7.graphics.Palette$Builder.generate(Palette.java:557)
         at android.support.v7.graphics.Palette$Builder$1.doInBackground(Palette.java:623)
         at android.support.v7.graphics.Palette$Builder$1.doInBackground(Palette.java:620)
         at android.os.AsyncTask$2.call(AsyncTask.java:288)
         at java.util.concurrent.FutureTask.run(FutureTask.java:237)
         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
         at java.lang.Thread.run(Thread.java:818)
  </code></pre>
  
  <p>I am using the Palette class from <code>com.android.support:palette-v7:23+</code></p>
  
  <p>Any ideas of what might be wrong? </p>