feat: final details + docs

This commit is contained in:
2026-01-09 00:11:37 +01:00
parent 1c642ee207
commit 7d78cc8058
4 changed files with 24 additions and 12 deletions

View File

@@ -15,7 +15,7 @@ def parse_image(src: str, target_src: str, max_vertical_size_px: int, max_horizo
max_vertical_size_px = rawImage.height
target_height = max_vertical_size_px
target_width = math.ceil(rawImage.width * max_vertical_size_px / rawImage.height)
else:
else:
if (max_horizontal_size_px == None or max_horizontal_size_px < 1):
max_horizontal_size_px = rawImage.width
target_width = max_horizontal_size_px
@@ -31,8 +31,7 @@ def parse_image(src: str, target_src: str, max_vertical_size_px: int, max_horizo
else:
target_src = os.path.abspath(target_src)
full_path = os.path.join(target_src, filename)
print(">> Path: ", full_path)
# rawImage.save(full_path)
rawImage.save(full_path)
def parse_whole_directory(dir_src: str, target_src: str, max_vertical_size_px: int, max_horizontal_size_px: int, target_extension: str):
for file_path in get_file_path_iter(dir_src):