Created
January 19, 2014 15:35
-
-
Save acontal/8506445 to your computer and use it in GitHub Desktop.
[android] Save the raw preview image provided by the Camera's preview as a JPEG file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Input: byte[] data, int width, int height, File jpegFile | |
YuvImage yuvImage = new YuvImage(data, ImageFormat.NV21, width, height, null); | |
FileOutputStream jepgFileOS = new FileOutputStream(jpegFile); | |
yuvimage.compressToJpeg(new Rect(0, 0, width, height), 95, jpegFileOS); | |
jpegFileOS.close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment