Skip to content

Commit

Permalink
fix: removed files not other than odm accepted files in processing
Browse files Browse the repository at this point in the history
  • Loading branch information
nrjadkry committed Feb 11, 2025
1 parent 84582e7 commit 8e05d13
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/backend/app/projects/image_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,21 @@ async def download_images_from_s3(

log.info(f"Downloading images from S3 for task {task_id}...")

accepted_file_extensions = (".jpg", ".jpeg", ".png", ".txt", ".laz")

s3_download_url = settings.S3_DOWNLOAD_ROOT
if s3_download_url:
object_urls = [f"{s3_download_url}/{obj.object_name}" for obj in objects]
object_urls = [
f"{s3_download_url}/{obj.object_name}"
for obj in objects
if obj.object_name.lower().endswith(accepted_file_extensions)
]
else:
# generate pre-signed URL for each object
object_urls = [
get_presigned_url(bucket_name, obj.object_name, 12) for obj in objects
get_presigned_url(bucket_name, obj.object_name, 12)
for obj in objects
if obj.object_name.lower().endswith(accepted_file_extensions)
]

total_files = len(object_urls)
Expand Down

0 comments on commit 8e05d13

Please sign in to comment.