Merge pull request #674 from just-football/master

[Fix] Image orientation bug when mirroring set to true
This commit is contained in:
Nick Pomfret 2017-04-26 09:44:57 +01:00 committed by GitHub
commit d54eae9ea5
1 changed files with 6 additions and 6 deletions

View File

@ -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");