Add icc_profile fix and position relative.

This commit is contained in:
voussoir 2023-03-26 22:07:19 -07:00
parent 983c4225fb
commit 4d1cf4e485
2 changed files with 4 additions and 2 deletions

View file

@ -67,6 +67,7 @@ header > *
.album,
.photograph
{
position: relative;
margin-left: auto;
margin-right: auto;
margin-top: 8vh;

View file

@ -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