diff --git a/cope2n-api/fwd_api/utils/process.py b/cope2n-api/fwd_api/utils/process.py index cbedbeb..7a833c9 100644 --- a/cope2n-api/fwd_api/utils/process.py +++ b/cope2n-api/fwd_api/utils/process.py @@ -1,4 +1,5 @@ import os +import uuid import random import string import tempfile @@ -23,7 +24,6 @@ from ..exception.exceptions import InvalidException, NotFoundException, \ from ..models import UserProfile, OcrTemplate, OcrTemplateBox, \ Subscription, SubscriptionRequestFile, SubscriptionRequest from ..celery_worker.client_connector import c_connector -import uuid from celery.utils.log import get_task_logger @@ -411,7 +411,7 @@ def process_image_local_file(file_name: str, file_path: str, request: Subscripti def pdf_to_images_urls(doc_path, request: SubscriptionRequest, user, dpi: int = 300) -> list: pdf_extracted = [] saving_path = FileUtils.get_folder_path(request) - break_file_name = f'break_0.jpg' + break_file_name = f'{os.path.basename(doc_path.name)}_page_0.jpg' saving_path = os.path.join(saving_path, break_file_name) image = get_first_page_pdf(doc_path, 300)