forked from varia/distribusi
remove errors
This commit is contained in:
parent
3eefd6e5ca
commit
1db3682210
@ -49,7 +49,7 @@ def thumbnail(full_path_image, name, args):
|
|||||||
thumbnail_image.thumbnail(size)
|
thumbnail_image.thumbnail(size)
|
||||||
|
|
||||||
if thumbnail_image.mode == "RGBA":
|
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)
|
composite = Image.alpha_composite(bg, thumbnail_image)
|
||||||
thumbnail_image = composite.convert("RGB")
|
thumbnail_image = composite.convert("RGB")
|
||||||
|
|
||||||
@ -146,10 +146,10 @@ def handle_image_files(name, full_path, args):
|
|||||||
if image_description is None:
|
if image_description is None:
|
||||||
return f'<a href="{name}"><img class="thumbnail" src="{thumbnail_filename}" alt="{image_alttext}"></a>'
|
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 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")
|
index = os.path.join(root, "index.html")
|
||||||
if "index.html" in files:
|
if "index.html" in files:
|
||||||
try:
|
try:
|
||||||
@ -183,7 +183,7 @@ def distribusify(args, directory): # noqa
|
|||||||
dirs, files = remove_hidden_files_and_folders(dirs, files)
|
dirs, files = remove_hidden_files_and_folders(dirs, files)
|
||||||
|
|
||||||
if args.remove_index:
|
if args.remove_index:
|
||||||
remove_index_html(root, files)
|
remove_index_html(root, files, args)
|
||||||
|
|
||||||
if args.verbose:
|
if args.verbose:
|
||||||
print("Generating directory listing for", root)
|
print("Generating directory listing for", root)
|
||||||
|
Loading…
Reference in New Issue
Block a user