From edef41ca327fe415051d0c1fce25aeaada8b9dd3 Mon Sep 17 00:00:00 2001 From: Vlad Korobov Date: Sun, 22 Sep 2024 15:37:51 -0400 Subject: [PATCH] portico: hello images are always x2 size --- templates/corporate/hello.html | 28 ++++++++------------- tools/setup/generate_landing_page_images.py | 12 ++++----- web/styles/portico/hello.css | 1 + 3 files changed, 17 insertions(+), 24 deletions(-) diff --git a/templates/corporate/hello.html b/templates/corporate/hello.html index a86c3b0fd9..a4fc1b3449 100644 --- a/templates/corporate/hello.html +++ b/templates/corporate/hello.html @@ -23,31 +23,24 @@ - +
@@ -100,17 +93,16 @@ + src="{{ static('images/landing-page/hello/generated/screen-2-mobile-2x.jpg') }}" + srcset="{{ static('images/landing-page/hello/generated/screen-2-mobile-2x.jpg') }}"/>
diff --git a/tools/setup/generate_landing_page_images.py b/tools/setup/generate_landing_page_images.py index 6d3276a903..6f425ed09b 100755 --- a/tools/setup/generate_landing_page_images.py +++ b/tools/setup/generate_landing_page_images.py @@ -32,12 +32,12 @@ def generate_landing_page_images() -> None: for image_file_path in glob.glob(f"{ORIGINAL_IMAGES_DIR}/*"): file_name = Path(image_file_path).stem image = pyvips.Image.new_from_file(image_file_path) - for size in (1, 2): - scaled_width = get_x_size(image.width, size) - scaled_height = get_x_size(image.height, size) - scaled = image.thumbnail_image(scaled_width, height=scaled_height) - for format in ("webp[Q=50]", "jpg[Q=70,optimize-coding=true]"): - scaled.write_to_file(f"{GENERATED_IMAGES_DIR}/{file_name}-{size}x.{format}") + size = 2 + scaled_width = get_x_size(image.width, size) + scaled_height = get_x_size(image.height, size) + scaled = image.thumbnail_image(scaled_width, height=scaled_height) + for format in ("webp[Q=55]", "jpg[Q=75,optimize-coding=true]"): + scaled.write_to_file(f"{GENERATED_IMAGES_DIR}/{file_name}-{size}x.{format}") if __name__ == "__main__": diff --git a/web/styles/portico/hello.css b/web/styles/portico/hello.css index 792d4f910a..cebf86e919 100644 --- a/web/styles/portico/hello.css +++ b/web/styles/portico/hello.css @@ -759,6 +759,7 @@ ul { .appshot-1__img { width: auto; + max-width: 400px; height: auto; }