Skip to content

Commit

Permalink
fix(android): increase screenshot quality
Browse files Browse the repository at this point in the history
  • Loading branch information
ridvanaltun committed Jul 3, 2022
1 parent 7877b6e commit fda7155
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions android/src/main/java/com/reactnativedeepar/RNTDeepAR.java
Expand Up @@ -160,17 +160,18 @@ private String saveToInternalStorage(Bitmap bitmapImage) {
}
}

FileOutputStream fos = null;
FileOutputStream outputStream = null;
try {
fos = new FileOutputStream(tempPath);
outputStream = new FileOutputStream(tempPath);
// Use the compress method on the BitMap object to write image to the OutputStream
bitmapImage.compress(Bitmap.CompressFormat.JPEG, 70, fos);
int quality = 100; // 0 to 100
bitmapImage.compress(Bitmap.CompressFormat.JPEG, quality, outputStream);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
fos.flush();
fos.close();
outputStream.flush();
outputStream.close();
} catch (IOException e) {
e.printStackTrace();
}
Expand Down Expand Up @@ -274,7 +275,6 @@ public void run() {
deepAr.takeScreenshot();
}
}, 100);

}

public void startRecording() {
Expand Down

0 comments on commit fda7155

Please sign in to comment.