diff --git a/distribusi/distribusi.py b/distribusi/distribusi.py index 87e4a7d..07b4200 100644 --- a/distribusi/distribusi.py +++ b/distribusi/distribusi.py @@ -49,7 +49,7 @@ def thumbnail(full_path_image, name, args): thumbnail_image.thumbnail(size) if thumbnail_image.mode == "RGBA": - bg = Image.new("RGBA", im.size, (255, 255, 255)) + bg = Image.new("RGBA", thumbnail_image.size, (255, 255, 255)) composite = Image.alpha_composite(bg, thumbnail_image) thumbnail_image = composite.convert("RGB") @@ -146,10 +146,10 @@ def handle_image_files(name, full_path, args): if image_description is None: return f'{image_alttext}' return f'
{image_alttext}
{image_description}
' - return FILE_TYPES[type_].format(name, image_alttext) + return FILE_TYPES["image"].format(name, image_alttext) -def remove_index_html(root, files): +def remove_index_html(root, files, args): index = os.path.join(root, "index.html") if "index.html" in files: try: @@ -183,7 +183,7 @@ def distribusify(args, directory): # noqa dirs, files = remove_hidden_files_and_folders(dirs, files) if args.remove_index: - remove_index_html(root, files) + remove_index_html(root, files, args) if args.verbose: print("Generating directory listing for", root)