From 4ed03a8d92f3fe21188b6948b38da1b8522678f7 Mon Sep 17 00:00:00 2001 From: Jaret Burkett Date: Fri, 8 Sep 2023 16:32:14 -0600 Subject: [PATCH] Fixed issue with buckets scaling. again --- toolkit/dataloader_mixins.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/toolkit/dataloader_mixins.py b/toolkit/dataloader_mixins.py index 787657ec..7e103610 100644 --- a/toolkit/dataloader_mixins.py +++ b/toolkit/dataloader_mixins.py @@ -100,6 +100,7 @@ class BucketsMixin: # for file_item in enumerate(file_list): for idx, file_item in enumerate(file_list): + file_item: 'FileItemDTO' = file_item width = file_item.crop_width height = file_item.crop_height @@ -107,11 +108,11 @@ class BucketsMixin: # set the scaling height and with to match smallest size, and keep aspect ratio if width > height: - file_item.scale_height = bucket_resolution["height"] - file_item.scale_width = int(width * (bucket_resolution["height"] / height)) + file_item.scale_to_height = bucket_resolution["height"] + file_item.scale_to_width = int(width * (bucket_resolution["height"] / height)) else: - file_item.scale_width = bucket_resolution["width"] - file_item.scale_height = int(height * (bucket_resolution["width"] / width)) + file_item.scale_to_width = bucket_resolution["width"] + file_item.scale_to_height = int(height * (bucket_resolution["width"] / width)) file_item.crop_height = bucket_resolution["height"] file_item.crop_width = bucket_resolution["width"]