From 0edeadb846fb76479c5d122647b35af34e2b3653 Mon Sep 17 00:00:00 2001 From: gooker_young Date: Sat, 4 Jul 2026 09:50:15 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=E9=85=8D=E7=BD=AE=E5=9B=BD=E5=86=85Py?= =?UTF-8?q?PI=E9=95=9C=E5=83=8F=E6=BA=90=E5=8A=A0=E9=80=9F=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E5=AE=89=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 6 ++++++ src/pyflowx/cli/pdftool.py | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index fb91297..4a3efcd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,12 @@ # 备选镜像源前缀:docker.1ms.run / dockerpull.com / docker.xuanyuan.me FROM docker.m.daocloud.io/python:3.13-slim +# 国内镜像源(清华) +ENV PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple +ENV PIP_TRUSTED_HOST=pypi.tuna.tsinghua.edu.cn +ENV UV_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple +ENV UV_TRUSTED_HOST=pypi.tuna.tsinghua.edu.cn + # 环境变量:非交互 + 路径配置 ENV DEBIAN_FRONTEND=noninteractive \ LANG=C.UTF-8 \ diff --git a/src/pyflowx/cli/pdftool.py b/src/pyflowx/cli/pdftool.py index 52476f1..d850c8b 100644 --- a/src/pyflowx/cli/pdftool.py +++ b/src/pyflowx/cli/pdftool.py @@ -286,7 +286,8 @@ def pdf_ocr(input_path: Path, output_path: Path, lang: str = "chi_sim+eng") -> N new_page = new_doc.new_page(width=page.rect.width, height=page.rect.height) new_page.insert_image(new_page.rect, pixmap=pix) text_rect = fitz.Rect(0, 0, page.rect.width, page.rect.height) - new_page.insert_textbox(text_rect, ocr_text) + # pyrefly: ignore [bad-argument-type] + new_page.insert_textbox(text_rect, ocr_text, fontname="china-ss", fontsize=11) output_path.parent.mkdir(parents=True, exist_ok=True) new_doc.save(str(output_path))