@carviz/capacitor-camera-preview 7.0.1 → 7.0.3
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.
|
@@ -152,7 +152,7 @@ class CameraController: NSObject {
|
|
|
152
152
|
// Note that zoomFactor 2 "equals" the regular 1x zoom factor of the native iphone camera app
|
|
153
153
|
// 0.5x however equal a videoZoomFactor of 1. We do not want to use ultra wide angle by default
|
|
154
154
|
// the default videoZoomFactor to 2 in case the current camera device type is .builtInTripleCamera
|
|
155
|
-
cameraDevice.videoZoomFactor =
|
|
155
|
+
cameraDevice.videoZoomFactor = 2
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carviz/capacitor-camera-preview",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.3",
|
|
4
4
|
"description": "Fork of the capacitor-community/camera-preview plugin focusing on high resolution photos without bloating up the code.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/plugin.cjs.js",
|
package/ios/Plugin/UIImage.swift
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
extension UIImage {
|
|
2
|
-
func fixedOrientation() -> UIImage? {
|
|
3
|
-
guard imageOrientation != UIImage.Orientation.up else {
|
|
4
|
-
// This is default orientation, don't need to do anything
|
|
5
|
-
return self.copy() as? UIImage
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
guard let cgImage = self.cgImage else {
|
|
9
|
-
// CGImage is not available
|
|
10
|
-
return nil
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
guard let colorSpace = cgImage.colorSpace, let ctx = CGContext(data: nil, width: Int(size.width), height: Int(size.height), bitsPerComponent: cgImage.bitsPerComponent, bytesPerRow: 0, space: colorSpace, bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue) else {
|
|
14
|
-
// Not able to create CGContext
|
|
15
|
-
return nil
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
var transform: CGAffineTransform = CGAffineTransform.identity
|
|
19
|
-
|
|
20
|
-
switch imageOrientation {
|
|
21
|
-
case .down, .downMirrored:
|
|
22
|
-
transform = transform.translatedBy(x: size.width, y: size.height)
|
|
23
|
-
transform = transform.rotated(by: CGFloat.pi)
|
|
24
|
-
print("down")
|
|
25
|
-
break
|
|
26
|
-
case .left, .leftMirrored:
|
|
27
|
-
transform = transform.translatedBy(x: size.width, y: 0)
|
|
28
|
-
transform = transform.rotated(by: CGFloat.pi / 2.0)
|
|
29
|
-
print("left")
|
|
30
|
-
break
|
|
31
|
-
case .right, .rightMirrored:
|
|
32
|
-
transform = transform.translatedBy(x: 0, y: size.height)
|
|
33
|
-
transform = transform.rotated(by: CGFloat.pi / -2.0)
|
|
34
|
-
print("right")
|
|
35
|
-
break
|
|
36
|
-
case .up, .upMirrored:
|
|
37
|
-
break
|
|
38
|
-
@unknown default:
|
|
39
|
-
break
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
ctx.concatenate(transform)
|
|
43
|
-
|
|
44
|
-
switch imageOrientation {
|
|
45
|
-
case .left, .leftMirrored, .right, .rightMirrored:
|
|
46
|
-
ctx.draw(self.cgImage!, in: CGRect(x: 0, y: 0, width: size.height, height: size.width))
|
|
47
|
-
default:
|
|
48
|
-
ctx.draw(self.cgImage!, in: CGRect(x: 0, y: 0, width: size.width, height: size.height))
|
|
49
|
-
break
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
guard let newCGImage = ctx.makeImage() else { return nil }
|
|
53
|
-
|
|
54
|
-
return UIImage.init(cgImage: newCGImage, scale: 1, orientation: .up)
|
|
55
|
-
}
|
|
56
|
-
}
|