Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

fix too large thumbnail issue (#817)

KevinHuShc3bc72dfd98c
diff --git a/api/utils/file_utils.py b/api/utils/file_utils.py
index a062b93eed..ab859aaba3 100644
--- a/api/utils/file_utils.py
+++ b/api/utils/file_utils.py
@@ -174,7 +174,7 @@ def thumbnail(filename, blob):
if re.match(r".*\.pdf$", filename):
pdf = pdfplumber.open(BytesIO(blob))
buffered = BytesIO()
- pdf.pages[0].to_image().annotated.save(buffered, format="png")
+ pdf.pages[0].to_image(resolution=32).annotated.save(buffered, format="png")
return "data:image/png;base64," + \
base64.b64encode(buffered.getvalue()).decode("utf-8")