From 4d1cf4e485f58f2b613584d9979cdb91ebebd3ef Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 26 Mar 2023 22:07:19 -0700 Subject: [PATCH] Add icc_profile fix and position relative. --- voussoir.net/photography/dark.css | 1 + voussoir.net/photography/generate_site.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/voussoir.net/photography/dark.css b/voussoir.net/photography/dark.css index 4169df4..a05a3df 100644 --- a/voussoir.net/photography/dark.css +++ b/voussoir.net/photography/dark.css @@ -67,6 +67,7 @@ header > * .album, .photograph { + position: relative; margin-left: auto; margin-right: auto; margin-top: 8vh; diff --git a/voussoir.net/photography/generate_site.py b/voussoir.net/photography/generate_site.py index e4119b4..8ad518e 100644 --- a/voussoir.net/photography/generate_site.py +++ b/voussoir.net/photography/generate_site.py @@ -263,7 +263,7 @@ def write_directory_index(directory): } function scroll_to_img(img) { - const img_centerline = img.offsetTop + (img.offsetHeight / 2); + const img_centerline = img.offsetParent.offsetTop + img.offsetTop + (img.offsetHeight / 2); // document.body.scrollTop = img_centerline - (window.innerHeight / 2); desired_scroll_position = Math.round(img_centerline - (window.innerHeight / 2)); scroll_step(); @@ -348,11 +348,12 @@ def make_thumbnail(photo): if small_name.is_file: return small_name image = PIL.Image.open(photo.absolute_path) + icc = image.info.get('icc_profile') (image_width, image_height) = image.size exif = image.getexif() (width, height) = imagetools.fit_into_bounds(image_width, image_height, 1440, 1440) image = image.resize((width, height), PIL.Image.LANCZOS) - image.save(small_name.absolute_path, quality=75, exif=exif) + image.save(small_name.absolute_path, quality=75, exif=exif, icc_profile=icc) print(small_name) return small_name