From 93177c8604699bb9ddee10d66fb3dc727acbec8f Mon Sep 17 00:00:00 2001 From: Marcus Andersson Date: Wed, 20 Dec 2017 20:25:01 +0100 Subject: [PATCH] changed so we use the correct exceptions. --- .../Example/Images.xcassets/AppIcon.appiconset/Contents.json | 5 +++++ .../main/java/com/lwansbrough/RCTCamera/MutableImage.java | 2 +- .../main/java/com/lwansbrough/RCTCamera/RCTCameraModule.java | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Example/ios/Example/Images.xcassets/AppIcon.appiconset/Contents.json b/Example/ios/Example/Images.xcassets/AppIcon.appiconset/Contents.json index b8236c6..19882d5 100644 --- a/Example/ios/Example/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/Example/ios/Example/Images.xcassets/AppIcon.appiconset/Contents.json @@ -39,6 +39,11 @@ "idiom" : "iphone", "size" : "60x60", "scale" : "3x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" } ], "info" : { diff --git a/android/src/main/java/com/lwansbrough/RCTCamera/MutableImage.java b/android/src/main/java/com/lwansbrough/RCTCamera/MutableImage.java index ed2f6f0..74a3515 100644 --- a/android/src/main/java/com/lwansbrough/RCTCamera/MutableImage.java +++ b/android/src/main/java/com/lwansbrough/RCTCamera/MutableImage.java @@ -76,7 +76,7 @@ public class MutableImage { } } - public void cropToPreview(int orientation, float xPercentage, float yPercentage) throws ImageMutationFailedException { + public void cropToPreview(int orientation, float xPercentage, float yPercentage) throws IllegalArgumentException { int width = this.currentRepresentation.getWidth(); int height = this.currentRepresentation.getHeight(); diff --git a/android/src/main/java/com/lwansbrough/RCTCamera/RCTCameraModule.java b/android/src/main/java/com/lwansbrough/RCTCamera/RCTCameraModule.java index ce6d1cc..d58fe1d 100644 --- a/android/src/main/java/com/lwansbrough/RCTCamera/RCTCameraModule.java +++ b/android/src/main/java/com/lwansbrough/RCTCamera/RCTCameraModule.java @@ -589,7 +589,7 @@ public class RCTCameraModule extends ReactContextBaseJavaModule int orientation = _reactContext.getResources().getConfiguration().orientation; mutableImage.cropToPreview(orientation, paddingWidth, paddingHeight); - } catch (MutableImage.ImageMutationFailedException e) { + } catch (IllegalArgumentException e) { promise.reject("Error cropping image to preview", e); } }