diff --git a/builder.py b/builder.py index 646af71..aeac3b8 100755 --- a/builder.py +++ b/builder.py @@ -168,11 +168,14 @@ def list_folder(folder: str, title: str) -> None: extsplit = os.path.splitext(item) contains_files = True if extsplit[1].lower() in args.file_extensions: - image = { - "url": f"{args.web_root_url}{baseurl}{urllib.parse.quote(item)}", - "thumbnail": f"{args.web_root_url}.thumbnails/{baseurl}{urllib.parse.quote(extsplit[0])}.jpg", - "name": item, - } + with Image.open(os.path.join(folder, item)) as img: + image = { + "url": f"{args.web_root_url}{baseurl}{urllib.parse.quote(item)}", + "thumbnail": f"{args.web_root_url}.thumbnails/{baseurl}{urllib.parse.quote(extsplit[0])}.jpg", + "name": item, + "width": img.width, + "height": img.height, + } if not os.path.exists(os.path.join(args.root_directory, ".thumbnails", foldername, item)): thumbnails.append((folder, item)) for raw in RAW_EXTENSIONS: @@ -228,6 +231,7 @@ def list_folder(folder: str, title: str) -> None: subdirectories=subfolders, images=image_chunks, info=_info, + allimages=images, ) f.write(content) else: diff --git a/files/pswp/default-skin/default-skin.css b/files/pswp/default-skin/default-skin.css new file mode 100644 index 0000000..f99db1b --- /dev/null +++ b/files/pswp/default-skin/default-skin.css @@ -0,0 +1,483 @@ +/*! PhotoSwipe Default UI CSS by Dmitry Semenov | photoswipe.com | MIT license */ +/* + + Contents: + + 1. Buttons + 2. Share modal and links + 3. Index indicator ("1 of X" counter) + 4. Caption + 5. Loading indicator + 6. Additional styles (root element, top bar, idle state, hidden state, etc.) + +*/ +/* + + 1. Buttons + + */ +/* + + + +
+
+
+
+
+
+
+ +
+
+
+ + +
+
+
+ + + + + {%- endif %} \ No newline at end of file