mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 12:32:30 +08:00
Fix: fixed invalid save() arguments for slide thumbnails (#8851)
### What problem does this PR solve? Fixed invalid save() arguments for slide thumbnails. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -43,8 +43,9 @@ class Ppt(PptParser):
|
||||
with BytesIO() as buffered:
|
||||
slide.get_thumbnail(
|
||||
0.5, 0.5).save(
|
||||
buffered, drawing.imaging.ImageFormat.jpeg, quality=80)
|
||||
imgs.append(Image.open(buffered))
|
||||
buffered, drawing.imaging.ImageFormat.jpeg)
|
||||
buffered.seek(0)
|
||||
imgs.append(Image.open(buffered).copy())
|
||||
except RuntimeError as e:
|
||||
raise RuntimeError(f'ppt parse error at page {i+1}, original error: {str(e)}') from e
|
||||
assert len(imgs) == len(
|
||||
|
||||
@ -302,7 +302,7 @@ async def build_chunks(task, progress_callback):
|
||||
d["image"].close() # Close original image
|
||||
d["image"] = converted_image
|
||||
d["image"].save(output_buffer, format='JPEG')
|
||||
|
||||
|
||||
async with minio_limiter:
|
||||
await trio.to_thread.run_sync(lambda: STORAGE_IMPL.put(task["kb_id"], d["id"], output_buffer.getvalue()))
|
||||
d["img_id"] = "{}-{}".format(task["kb_id"], d["id"])
|
||||
@ -631,7 +631,7 @@ async def do_handle_task(task):
|
||||
nursery.start_soon(delete_image, task_dataset_id, chunk_id)
|
||||
progress_callback(-1, msg=f"Chunk updates failed since task {task['id']} is unknown.")
|
||||
return
|
||||
|
||||
|
||||
logging.info("Indexing doc({}), page({}-{}), chunks({}), elapsed: {:.2f}".format(task_document_name, task_from_page,
|
||||
task_to_page, len(chunks),
|
||||
timer() - start_ts))
|
||||
@ -723,8 +723,8 @@ async def report_status():
|
||||
finally:
|
||||
redis_lock.release()
|
||||
await trio.sleep(30)
|
||||
|
||||
|
||||
|
||||
|
||||
async def task_manager():
|
||||
try:
|
||||
await handle_task()
|
||||
|
||||
Reference in New Issue
Block a user