I I have tried this method to convert but result image is getting currupted
ByteArrayOutputStream outputStream=new ByteArrayOutputStream();
scaled.compress(Bitmap.CompressFormat.JPEG,100, outputStream);
byte [] bytes = outp`enter code here`utStream.toByteArray();
ByteArrayOutputStream out = new ByteArrayOutputStream();
YuvImage image = new YuvImage(bytes, ImageFormat.NV21, inputWidth, inputHeight, null);
int quality = 100; //
image.compressToJpeg(new Rect(0, 0, inputWidth, inputHeight), quality, out);
byte[] yuv = out.toByteArray();
I use the following code:
}