react-native-rectangle-doc-scanner 1.14.0 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-rectangle-doc-scanner",
3
- "version": "1.14.0",
3
+ "version": "1.15.0",
4
4
  "description": "Native-backed document scanner for React Native with customizable overlays.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -15,7 +15,8 @@
15
15
  },
16
16
  "scripts": {
17
17
  "build": "tsc",
18
- "prepare": "yarn build"
18
+ "prepare": "yarn build",
19
+ "postinstall": "patch-package"
19
20
  },
20
21
  "peerDependencies": {
21
22
  "@shopify/react-native-skia": "*",
@@ -26,6 +27,7 @@
26
27
  "devDependencies": {
27
28
  "@types/react": "^18.2.41",
28
29
  "@types/react-native": "0.73.0",
30
+ "patch-package": "^8.0.0",
29
31
  "typescript": "^5.3.3"
30
32
  },
31
33
  "dependencies": {
@@ -0,0 +1,22 @@
1
+ diff --git a/node_modules/react-native-document-scanner/ios/IPDFCameraViewController.m b/node_modules/react-native-document-scanner/ios/IPDFCameraViewController.m
2
+ index 1234567..abcdefg 100644
3
+ --- a/node_modules/react-native-document-scanner/ios/IPDFCameraViewController.m
4
+ +++ b/node_modules/react-native-document-scanner/ios/IPDFCameraViewController.m
5
+ @@ -115,7 +115,16 @@
6
+
7
+ NSError *error = nil;
8
+ AVCaptureDeviceInput* input = [AVCaptureDeviceInput deviceInputWithDevice:device error:&error];
9
+ - session.sessionPreset = AVCaptureSessionPresetPhoto;
10
+ +
11
+ + // Try to use the highest quality preset available
12
+ + if ([session canSetSessionPreset:AVCaptureSessionPreset3840x2160]) {
13
+ + session.sessionPreset = AVCaptureSessionPreset3840x2160; // 4K
14
+ + } else if ([session canSetSessionPreset:AVCaptureSessionPreset1920x1080]) {
15
+ + session.sessionPreset = AVCaptureSessionPreset1920x1080; // Full HD
16
+ + } else {
17
+ + session.sessionPreset = AVCaptureSessionPresetPhoto; // Fallback
18
+ + }
19
+ +
20
+ [session addInput:input];
21
+
22
+ AVCaptureVideoDataOutput *dataOutput = [[AVCaptureVideoDataOutput alloc] init];