BitmapFactory.Options.inSampleSize not being honored?
<p>I have a photo on disk with dimensions 2560 x 1920. This is often too large to load into memory, so I'm trying to use BitmapFactory.Options.inSampleSize to conserve memory. From the docs:</p>

<blockquote>
  <p>inSampleSize: If set to a value > 1, requests the decoder to subsample the original image, returning a smaller image to save memory.</p>
</blockquote>

<p>This is how I use it:</p>

<pre><code>BitmapFactory.Options optsDownSample = new BitmapFactory.Options();
optsDownSample.inSampleSize = 3;

Bitmap bmp = BitmapFactory.decodeFile(path, optsDownSample);
</code></pre>

<p>but the app still sometimes crashes on the last line there, and from logcat I can see it's trying to allocate ~5mb, and I suspect this is because the downsampling is not really being honored.</p>

<p>Anyone else know what could be going on here, am I using inSampleSize incorrectly?</p>

<p>Thanks</p>
