remove errors

This commit is contained in:
crunk 2024-07-22 21:57:01 +02:00
parent 3eefd6e5ca
commit 1db3682210

View File

@ -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'<a href="{name}"><img class="thumbnail" src="{thumbnail_filename}" alt="{image_alttext}"></a>'
return f'<figure><a href="{name}"><img class="thumbnail" src="{thumbnail_filename}" alt="{image_alttext}"></a><figcaption>{image_description}</figcaption></figure>'
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)