mirror of
https://github.com/status-im/react-native-camera.git
synced 2025-02-24 09:48:17 +00:00
Merge pull request #674 from just-football/master
[Fix] Image orientation bug when mirroring set to true
This commit is contained in:
commit
d54eae9ea5
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user