@@ -86,6 +86,9 @@ def image_process(image_np, image_path, is_from_pdf=False, is_from_docx=False, u
log("into image_preprocess")
try:
+ if image_np is None:
+ return []
+
# 整体分辨率限制
if image_np.shape[0] > 2000 or image_np.shape[1] > 2000:
h, w = get_best_predict_size2(image_np, threshold=2000)
@@ -197,6 +197,8 @@ def _isr():
result = result.get("image")
if judge_error_code(result):
return json.dumps({"image": result})
+ if isinstance(result, list) and result == [1]:
+ return json.dumps({"image": result})
img_replace = result
# numpy转为可序列化的string