mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 12:32:30 +08:00
Fix: Improve Memory Usage For Presentation (#8792)
### What problem does this PR solve? https://github.com/infiniflow/ragflow/issues/8791 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -40,10 +40,10 @@ class Ppt(PptParser):
|
||||
with slides.Presentation(BytesIO(fnm)) as presentation:
|
||||
for i, slide in enumerate(presentation.slides[from_page: to_page]):
|
||||
try:
|
||||
buffered = BytesIO()
|
||||
with BytesIO() as buffered:
|
||||
slide.get_thumbnail(
|
||||
0.5, 0.5).save(
|
||||
buffered, drawing.imaging.ImageFormat.jpeg)
|
||||
buffered, drawing.imaging.ImageFormat.jpeg, quality=80)
|
||||
imgs.append(Image.open(buffered))
|
||||
except RuntimeError as e:
|
||||
raise RuntimeError(f'ppt parse error at page {i+1}, original error: {str(e)}') from e
|
||||
|
||||
Reference in New Issue
Block a user