react-native-text-reader 1.1.0 → 1.2.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.
@@ -33,6 +33,10 @@ class TextReader: NSObject {
33
33
  self.handleTextRecognitionResult(request: request, threshold: threshold, error: error, resolve: resolve, reject: reject)
34
34
  }
35
35
 
36
+ if #available(iOS 16.0, *) {
37
+ ocrRequest.automaticallyDetectsLanguage = true
38
+ }
39
+
36
40
  try requestHandler.perform([ocrRequest])
37
41
  } catch {
38
42
  reject("ERR_IMAGE_LOADING", "Failed to load or process the image: \(error.localizedDescription)", nil)
@@ -51,7 +55,7 @@ class TextReader: NSObject {
51
55
  }
52
56
 
53
57
  if observations.isEmpty {
54
- reject("ERR_NO_TEXT_FOUND", "No text found in the image.", nil)
58
+ resolve([])
55
59
  return
56
60
  }
57
61
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-text-reader",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "description": "A React Native library for OCR (Optical Character Recognition) using Vision Framework on iOS and Firebase ML Kit on Android.",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",