diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-05-26 21:45:02 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-05-26 21:45:02 +0200 |
commit | 26e25619eb23ac3c1e16d1f496655947917a2591 (patch) | |
tree | ea7773bbf2b6a2c78b9b28750d93a384a51b27c2 /bin | |
parent | 0e4badb22d7666d0db3737cb3a910437b5b0bf52 (diff) |
Revert "detail page: use average image color for background"
This reverts commit 0e4badb22d7666d0db3737cb3a910437b5b0bf52.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/pyggle | 18 |
1 files changed, 3 insertions, 15 deletions
@@ -191,7 +191,7 @@ class Thumbnail: im = im.convert("RGB") im.save(self.thumbname, "JPEG") - if args.with_detail_page: + if args.with_detail_page and 0: self.average_color = im.resize((1, 1)).getpixel((0, 0)) self.luminance = im.convert("L").getpixel((0, 0)) @@ -359,20 +359,8 @@ class Thumbnail: def to_detail_html(self, html_prefix, html_postfix): with open(f"{self.filename}.html", "w") as f: - prefix = html_prefix.replace("<!-- $title -->", self.filename) - r, g, b = self.average_color - prefix = prefix.replace( - "<html>", f"""<html style="background-color: #{r:02x}{g:02x}{b:02x}">""" - ) - prefix = prefix.replace( - "<body>", f"""<body style="background-color: #{r:02x}{g:02x}{b:02x}">""" - ) - if self.luminance >= 127: - prefix = prefix.replace("<!-- $theme -->", "light") - else: - prefix = prefix.replace("<!-- $theme -->", "dark") - f.write(prefix) - f.write(self.html.to_detail_html(self.filename, self.exif_tag)) + f.write(html_prefix.replace("<!-- $title -->", self.filename)) + f.write(self.html.to_detail_html(self.filename)) f.write(html_postfix) |