title: Corrupted data from the camera
body: <p>I'm having some issues with a particular device (BQ Aquaris M5 - Android 5.0.2) which returns some  data from the onPictureTaken() camera callback. The colors are completely messed up: </p>
  
  <p><a href="https://i.stack.imgur.com/CWmXr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CWmXr.png" alt="enter image description here"></a></p>
  
  <p>This has never happened before and I've tested in several devices already without any issues.</p>
  
  <p>Things that I've already seen/tried:</p>
  
  <ul>
  <li>Using the back camera instead of the front camera, displays the image correctly.</li>
  <li>The SurfaceView displays the image correctly.</li>
  <li>Increasing the delay between the photo is taken and the camera is opened (We had an issue before that made the image blurry, and running the takePicture within a PostDelayed of several hundreds of ms solved the issue).</li>
  <li><p>Data from the callback is already corrupted. Image is displayed as a icon marker in a GMaps Activity passed (after resized) as a bundle extra for a new intent.</p>
  
  <pre><code>final byte[] photo = b.getByteArray("photo");
  Marker marker = map.addMarker(new MarkerOptions().position(new LatLng(lat, lon)));
  
  if (photo!=null){
      final Bitmap bmpPhoto = BitmapFactory.decodeByteArray(photo, 0, photo.length);
      marker.setIcon(BitmapDescriptorFactory.fromBitmap(bmpPhoto));            
  }
  </code></pre></li>
  </ul>