Skip to content

Commit

Permalink
fix too large thumbnail issue (infiniflow#817)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

infiniflow#709

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
  • Loading branch information
KevinHuSh committed May 17, 2024
1 parent 208fd41 commit 2dcfbd7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion api/utils/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit 2dcfbd7

Please sign in to comment.