title: JavaCV AndroidFrameConverter converted Bitmap imperfect on saving to local storage
body: <p>I am trying to convert a byte array of image data into a bitmap using Android frame converter as shown below:</p>
  
  <pre><code>((ByteBuffer) frame.image[0].position(0)).put(event.getImageData());// frame is a javacv frame.
  backCamFilter.push(frame); //FFmpegFrameFilter
  pulledFrame = backCamFilter.pull();
  byte[] data = ((ByteBuffer)pulledFrame.image[0].position(0)).array();
  Frame convertedFrame = converter.convert(data, 480, 480);//AndroidFrameConverter
  Bitmap bitmap = converter.convert(convertedFrame);
  if (bitmap != null) {
      outputStream = new FileOutputStream(Constants.COVER_IMAGE_FOLDER + "/" + System.currentTimeMillis() + ".jpg");
      bitmap.compress(Bitmap.CompressFormat.JPEG, 75, outputStream);
      Log.d(TAG, "writeCoverImage: " + count);
  }
  </code></pre>
  
  <p>The above code generates the image added below, as you can see the left portion of the image contains a part of the right part of the image. Does any of you guys know why this happens or any alternative solutions?</p>
  
  <p>I also tried converting the 'pulledFrame' directly into bitmap but its giving me "RuntimeException: Buffer not large enough for pixels".</p>
  
  <p><a href="https://i.stack.imgur.com/yPRu2.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yPRu2.jpg" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/fyE0a.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fyE0a.jpg" alt="enter image description here"></a></p>