react-native-rectangle-doc-scanner 1.15.0 → 1.16.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
|
@@ -2,6 +2,16 @@ diff --git a/node_modules/react-native-document-scanner/ios/IPDFCameraViewContro
|
|
|
2
2
|
index 1234567..abcdefg 100644
|
|
3
3
|
--- a/node_modules/react-native-document-scanner/ios/IPDFCameraViewController.m
|
|
4
4
|
+++ b/node_modules/react-native-document-scanner/ios/IPDFCameraViewController.m
|
|
5
|
+
@@ -76,7 +76,7 @@
|
|
6
|
+
GLKView *view = [[GLKView alloc] initWithFrame:self.bounds];
|
|
7
|
+
view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
|
|
8
|
+
view.translatesAutoresizingMaskIntoConstraints = YES;
|
|
9
|
+
view.context = self.context;
|
|
10
|
+
- view.contentScaleFactor = 1.0f;
|
|
11
|
+
+ view.contentScaleFactor = [UIScreen mainScreen].scale;
|
|
12
|
+
view.drawableDepthFormat = GLKViewDrawableDepthFormat24;
|
|
13
|
+
[self insertSubview:view atIndex:0];
|
|
14
|
+
_glkView = view;
|
|
5
15
|
@@ -115,7 +115,16 @@
|
|
6
16
|
|
|
7
17
|
NSError *error = nil;
|
|
@@ -20,3 +30,31 @@ index 1234567..abcdefg 100644
|
|
|
20
30
|
[session addInput:input];
|
|
21
31
|
|
|
22
32
|
AVCaptureVideoDataOutput *dataOutput = [[AVCaptureVideoDataOutput alloc] init];
|
|
33
|
+
@@ -134,6 +143,14 @@
|
|
34
|
+
[session addOutput:dataOutput];
|
|
35
|
+
|
|
36
|
+
self.stillImageOutput = [[AVCaptureStillImageOutput alloc] init];
|
|
37
|
+
+
|
|
38
|
+
+ // Set high quality JPEG output
|
|
39
|
+
+ NSDictionary *outputSettings = @{
|
|
40
|
+
+ AVVideoCodecKey: AVVideoCodecJPEG,
|
|
41
|
+
+ AVVideoQualityKey: @(0.95)
|
|
42
|
+
+ };
|
|
43
|
+
+ [self.stillImageOutput setOutputSettings:outputSettings];
|
|
44
|
+
+
|
|
45
|
+
[session addOutput:self.stillImageOutput];
|
|
46
|
+
|
|
47
|
+
AVCaptureConnection *connection = [dataOutput.connections firstObject];
|
|
48
|
+
@@ -405,8 +422,10 @@
|
|
49
|
+
{
|
|
50
|
+
enhancedImage = [self correctPerspectiveForImage:enhancedImage withFeatures:rectangleFeature];
|
|
51
|
+
|
|
52
|
+
- UIGraphicsBeginImageContext(CGSizeMake(enhancedImage.extent.size.height, enhancedImage.extent.size.width));
|
|
53
|
+
- [[UIImage imageWithCIImage:enhancedImage scale:1.0 orientation:UIImageOrientationRight] drawInRect:CGRectMake(0,0, enhancedImage.extent.size.height, enhancedImage.extent.size.width)];
|
|
54
|
+
+ CGSize imageSize = CGSizeMake(enhancedImage.extent.size.height, enhancedImage.extent.size.width);
|
|
55
|
+
+ CGFloat scale = [UIScreen mainScreen].scale;
|
|
56
|
+
+ UIGraphicsBeginImageContextWithOptions(imageSize, NO, scale);
|
|
57
|
+
+ [[UIImage imageWithCIImage:enhancedImage scale:scale orientation:UIImageOrientationRight] drawInRect:CGRectMake(0,0, imageSize.width, imageSize.height)];
|
|
58
|
+
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
|
|
59
|
+
UIImage *initialImage = [UIImage imageWithData:imageData];
|
|
60
|
+
UIGraphicsEndImageContext();
|