@xuda.io/drive_module 1.1.938 → 1.1.940

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.
Files changed (2) hide show
  1. package/index.js +3 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1727,7 +1727,7 @@ const ocr_drive_file = async function (app_id, doc) {
1727
1727
  case "image": {
1728
1728
  const tesseract = require("node-tesseract-ocr");
1729
1729
  ocr = await tesseract.recognize(target_file, {
1730
- lang: "eng",
1730
+ // lang: "eng",
1731
1731
  oem: 1,
1732
1732
  psm: 3,
1733
1733
  });
@@ -1744,7 +1744,7 @@ const ocr_drive_file = async function (app_id, doc) {
1744
1744
  const images = await convertPDF(target_file);
1745
1745
  for await (const imageData of images) {
1746
1746
  ocr += await tesseract.recognize(imageData.path, {
1747
- lang: "eng",
1747
+ // lang: "eng",
1748
1748
  oem: 1,
1749
1749
  psm: 3,
1750
1750
  });
@@ -1793,7 +1793,7 @@ const ocr_drive_file = async function (app_id, doc) {
1793
1793
  break;
1794
1794
  }
1795
1795
 
1796
- doc.ocr = ocr.replace(/<\/?[^>]+(>|$)/g, "").replace(/[\n\t]/g, "");
1796
+ doc.ocr = ocr.replace(/<\/?[^>]+(>|$)/g, "").replace(/[\n\t]/g, " ");
1797
1797
  doc.ocr_stat = 3;
1798
1798
  } catch (err) {
1799
1799
  // doc.ocr_stat = 4;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/drive_module",
3
- "version": "1.1.938",
3
+ "version": "1.1.940",
4
4
  "description": "Xuda Drive Server Module",
5
5
  "main": "index.js",
6
6
  "dependencies": {