Selaa lähdekoodia

fix too large thumbnail issue (#817)

### What problem does this PR solve?

#709

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.6.0
KevinHuSh 1 vuosi sitten
vanhempi
commit
c3bc72dfd9
No account linked to committer's email address
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1
    1
      api/utils/file_utils.py

+ 1
- 1
api/utils/file_utils.py Näytä tiedosto

@@ -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")

Loading…
Peruuta
Tallenna