|
|
@ -14,15 +14,17 @@ MIME_TYPE = magic.Magic(mime=True) |
|
|
|
|
|
|
|
def caption(image): |
|
|
|
try: |
|
|
|
process = subprocess.Popen(['exiftool', '-Comment', image], stdout=subprocess.PIPE) |
|
|
|
process = subprocess.Popen( |
|
|
|
['exiftool', '-Comment', image], stdout=subprocess.PIPE) |
|
|
|
out, err = process.communicate() |
|
|
|
except Exception as e: |
|
|
|
print(e) |
|
|
|
print('Do you have exiftool installed?') |
|
|
|
try: |
|
|
|
caption = out.decode("utf-8").split(": ", 1)[1] |
|
|
|
except: |
|
|
|
except Exception as e: |
|
|
|
caption = '' |
|
|
|
print(e) |
|
|
|
return caption |
|
|
|
|
|
|
|
|
|
|
@ -47,7 +49,6 @@ def thumbnail(image, name, args): |
|
|
|
return "<figure><a href='{}'><img src='{}'></a><figcaption>{}</figcaption></figure>".format(name, name, name) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def div(args, type_, subtype, tag, name): |
|
|
|
id_name = name.split('.')[0].replace(' ', '_') |
|
|
|
if args.no_filenames: |
|
|
@ -71,7 +72,6 @@ def distribusify(args, directory): # noqa |
|
|
|
for root, dirs, files in os.walk(directory): |
|
|
|
if not args.remove_index: |
|
|
|
html = [] |
|
|
|
|
|
|
|
if args.verbose: |
|
|
|
print('Generating directory listing for', root) |
|
|
|
|
|
|
|