title: Android Camera takes multi lined bugged picture for some users
body: <ol>
  <li>Some users of my app are taking some bugged pictures that look like that:</li>
  </ol>
  <p><a href="https://i.stack.imgur.com/prSuw.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/prSuw.jpg" alt="enter image description here" /></a></p>
  
  <p>The only thing I do is standard bitmap API in jpegCallback:</p>
  <pre><code>BitmapFactory.Options opts = new BitmapFactory.Options();
  opts.inSampleSize = 4;
  bm = BitmapFactory.decodeByteArray(data, 0, data.length, opts);
  bm = Bitmap.createScaledBitmap(bm , 640, 480,  true);
  </code></pre>
  <p>and then write it on the disk</p>
  <pre><code> imageFile = new File(&quot;/sdcard/app_dir/upload.jpg&quot;);
   FileOutputStream outStream = new FileOutputStream(imageFile);
   bm.compress(CompressFormat.JPEG, 75, outStream);
   outStream.flush();
   outStream.close();
  </code></pre>
  <ol start="2">
  <li>edit: I've removed a call to setPreviewSize like explain there:
  <a href="https://stackoverflow.com/questions/5859876/android-jpeg-saved-from-camera-looks-corrupted">Android: Jpeg saved from camera looks corrupted</a></li>
  </ol>
  <p>I think it did help for some users (Desire HD), but I can tell others still got the issue (Desire S).</p>
  <p>I really wish someone could explain the reason why pics looks distorded in the first place.</p>