RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.
Go agent-harnessagent-native-databaseagentic-aiagentic-retrievalagentic-searchaiai-agentscontext-enginecontext-engineeringcontext-managementharness-engineeringknowledge-compilationragretrieval-augmented-generationretrieval-harnesssearch-harness
Fix broken data stream when writing image file (#9354)
Jay Xuce3dd019c3a9
diff --git a/rag/svr/task_executor.py b/rag/svr/task_executor.pyindex ba34103d9b..f089b0f4ec 100644--- a/rag/svr/task_executor.py+++ b/rag/svr/task_executor.py@@ -304,7 +304,11 @@ async def build_chunks(task, progress_callback):converted_image = d["image"].convert("RGB")d["image"].close() # Close original imaged["image"] = converted_image- d["image"].save(output_buffer, format='JPEG')+ try:+ d["image"].save(output_buffer, format='JPEG')+ except OSError as e:+ logging.warning(+ "Saving image of chunk {}/{}/{} got exception, ignore: {}".format(task["location"], task["name"], d["id"], str(e)))async with minio_limiter:await trio.to_thread.run_sync(lambda: STORAGE_IMPL.put(task["kb_id"], d["id"], output_buffer.getvalue()))