title: BitmapFactory.decodeByteArray returns null with inJustDecoteBounds=true in Android
body: <p>I want to resize a <code>Bitmap</code> to store it in a <code>HashMap</code> for later use.</p>
  
  <p>So I do the resizing in a <code>AsyncTask</code>.</p>
  
  <pre><code>final BitmapFactory.Options options = new BitmapFactory.Options();
  
  @Override
  protected Void doInBackground(byte[]... params) {
      byte[] bytes = params[0];
      options.inJustDecodeBounds = true;
      Bitmap test = BitmapFactory.decodeByteArray(bytes,0,bytes.length,options);
      int imgHeight = test.getHeight();
      int imgWidth = test.getWidth();
  
      int counter = 0;
      while (imgHeight &gt; 2000) {
          imgHeight = imgHeight / 2;
          counter++;
      }
      return null;
  }
  </code></pre>
  
  <p>My problem is that <code>test</code> is null. the <code>bytes</code> is not null and has a length of 273440.</p>
  
  <p>Where could be the problem?</p>
  
  <p>Thank you for help!</p>
  
  <p>Kind Regards!</p>