capacitor-plugin-camera-forked 3.0.111 → 3.0.113
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.
|
@@ -26,4 +26,6 @@ CAP_PLUGIN(CameraPreviewPlugin, "CameraPreview",
|
|
|
26
26
|
CAP_PLUGIN_METHOD(requestCameraPermission, CAPPluginReturnPromise);
|
|
27
27
|
CAP_PLUGIN_METHOD(requestMicroPhonePermission, CAPPluginReturnPromise);
|
|
28
28
|
CAP_PLUGIN_METHOD(isOpen, CAPPluginReturnPromise);
|
|
29
|
+
CAP_PLUGIN_METHOD(detectBlur, CAPPluginReturnPromise);
|
|
30
|
+
CAP_PLUGIN_METHOD(resetFocus, CAPPluginReturnPromise);
|
|
29
31
|
)
|
|
@@ -1245,8 +1245,16 @@ public class CameraPreviewPlugin: CAPPlugin, AVCaptureVideoDataOutputSampleBuffe
|
|
|
1245
1245
|
}
|
|
1246
1246
|
|
|
1247
1247
|
// Convert base64 string to UIImage
|
|
1248
|
-
let base64String
|
|
1249
|
-
|
|
1248
|
+
let base64String: String
|
|
1249
|
+
if imageString.hasPrefix("data:") {
|
|
1250
|
+
if let commaIndex = imageString.firstIndex(of: ",") {
|
|
1251
|
+
base64String = String(imageString[imageString.index(after: commaIndex)...])
|
|
1252
|
+
} else {
|
|
1253
|
+
base64String = imageString
|
|
1254
|
+
}
|
|
1255
|
+
} else {
|
|
1256
|
+
base64String = imageString
|
|
1257
|
+
}
|
|
1250
1258
|
|
|
1251
1259
|
guard let imageData = Data(base64Encoded: base64String),
|
|
1252
1260
|
let image = UIImage(data: imageData) else {
|
package/package.json
CHANGED