Update RCTCameraModule.java

This commit is contained in:
Rikard Franksson
2017-04-21 13:44:43 +02:00
committed by GitHub
parent 01189f8b7d
commit 8bccc77f65
@@ -561,6 +561,12 @@ public class RCTCameraModule extends ReactContextBaseJavaModule
* concurrently which would blow the memory (esp on smaller devices), and slow things down.
*/
private synchronized void processImage(MutableImage mutableImage, Boolean shouldMirror, ReadableMap options, Promise promise) {
try {
mutableImage.fixOrientation();
} catch (MutableImage.ImageMutationFailedException e) {
promise.reject("Error mirroring image", e);
}
if (shouldMirror) {
try {
mutableImage.mirrorImage();
@@ -569,12 +575,6 @@ public class RCTCameraModule extends ReactContextBaseJavaModule
}
}
try {
mutableImage.fixOrientation();
} catch (MutableImage.ImageMutationFailedException e) {
promise.reject("Error mirroring image", e);
}
int jpegQualityPercent = 80;
if(options.hasKey("jpegQuality")) {
jpegQualityPercent = options.getInt("jpegQuality");