fix "out of memory" if slide.get_thumbnail() to a huge image (#9211)

### What problem does this PR solve?

fix "out of memory" if slide.get_thumbnail() to a huge image

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Jay Xu
2025-08-04 16:08:24 +08:00
committed by GitHub
parent 6ad8b54754
commit cae11201ef

View File

@ -42,7 +42,7 @@ class Ppt(PptParser):
try: try:
with BytesIO() as buffered: with BytesIO() as buffered:
slide.get_thumbnail( slide.get_thumbnail(
0.5, 0.5).save( 0.1, 0.1).save(
buffered, drawing.imaging.ImageFormat.jpeg) buffered, drawing.imaging.ImageFormat.jpeg)
buffered.seek(0) buffered.seek(0)
imgs.append(Image.open(buffered).copy()) imgs.append(Image.open(buffered).copy())