@anytestforpm/ocr 1.3.3 → 1.3.5
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/ocr.js +3 -3
- package/package.json +1 -1
package/ocr.js
CHANGED
|
@@ -131,10 +131,10 @@ export const recognizeOCR = async (ImageUrl) => {
|
|
|
131
131
|
await worker.initialize(OCR_LANGUAGE_MAP[configData.region]);
|
|
132
132
|
|
|
133
133
|
//OCR辨識結果的內文
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
let result = await worker.recognize(ImageUrl);
|
|
135
|
+
let resText = String(result.data.text);
|
|
136
136
|
if (configData.region === "VN") {
|
|
137
|
-
resText = resText.replace(
|
|
137
|
+
resText = resText.replace(/\s+/g,"");
|
|
138
138
|
}
|
|
139
139
|
console.log("OCR Text >>> ", resText);
|
|
140
140
|
|