pi-ocr 1.1.0 → 1.1.2

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.
@@ -46,8 +46,15 @@ def progress(payload):
46
46
 
47
47
  progress({"status": "loading", "message": "Initializing Pix2Text models..."})
48
48
 
49
- from pix2text import Pix2Text
50
- p2t = Pix2Text.from_config(enable_formula=True, enable_table=False)
49
+ # Suppress model-loading noise on stdout during initialization
50
+ _real_stdout = sys.stdout
51
+ sys.stdout = sys.stderr
52
+
53
+ try:
54
+ from pix2text import Pix2Text
55
+ p2t = Pix2Text.from_config(enable_formula=True, enable_table=False)
56
+ finally:
57
+ sys.stdout = _real_stdout
51
58
 
52
59
  if ext == ".pdf":
53
60
  import fitz # PyMuPDF — already a pix2text dependency
@@ -68,7 +68,7 @@ async function convertPdfPage(pdfPath: string, pageIndex: number, outPath: strin
68
68
  async function tesseractImage(imagePath: string, _task: Task): Promise<string> {
69
69
  const { stdout, stderr, code } = await execCapture("tesseract", [
70
70
  imagePath, "stdout",
71
- "-l", "eng", // English by default; user can install more langs
71
+ "-l", "eng+chi_sim", // English + Chinese simplified
72
72
  "--psm", "3", // Auto page segmentation
73
73
  ]);
74
74
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-ocr",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Pi extension: Zero-setup multi-backend OCR — MinerU (free cloud), Ollama (local GPU, LaTeX formulas), Pix2Text (local Python). Extract text, formulas, and tables from images and PDFs. Default: zero config, works out of the box.",
5
5
  "keywords": [
6
6
  "pi-package",