Refine screenshot size

This commit is contained in:
Kaede Akino committed 2026-09-15 16:00:43 +08:00
1 parent 274ab1d3fc
commit fae324d00e
4 files changed
+12 -9

No files matched your search

+10 -7
View File
@@ -1,8 +1,9 @@
#!/usr/bin/env python3
"""Generate front-facing Termind device mockups using MockUPhone templates.
Raw screenshots are read-only inputs. Framed outputs are written alongside them
with a ``-framed.png`` suffix so the source captures remain available.
Raw screenshots are read-only inputs in Marketing/Screenshots/Captures. Framed
outputs are written to Marketing/Screenshots/DeviceFrames with a
``-framed.png`` suffix so source and derived marketing assets stay separate.
"""
from __future__ import annotations
@@ -17,7 +18,8 @@ from PIL import Image, ImageDraw, ImageFilter, ImageOps
REPOSITORY = Path(__file__).resolve().parents[1]
SCREENSHOTS = REPOSITORY / "LandingPage" / "public" / "screenshots"
CAPTURES = REPOSITORY / "Marketing" / "Screenshots" / "Captures"
DEVICE_FRAMES = REPOSITORY / "Marketing" / "Screenshots" / "DeviceFrames"
CACHE = REPOSITORY / ".build" / "mockuphone-assets"
MOCKUPHONE = "https://mockuphone.com/images"
FEATURES = ("vault", "sftp", "ssh", "metrics", "assistant")
@@ -156,8 +158,9 @@ def generate(source: Path, destination: Path, device: Device) -> None:
def mobile_sources(device_name: str):
for feature in FEATURES:
for locale in LOCALES:
source = SCREENSHOTS / feature / f"{device_name}-{locale}.png"
yield source, source.with_name(f"{device_name}-{locale}-framed.png")
source = CAPTURES / feature / f"{device_name}-{locale}.png"
destination = DEVICE_FRAMES / feature / f"{device_name}-{locale}-framed.png"
yield source, destination
def main() -> int:
@@ -165,8 +168,8 @@ def main() -> int:
*((source, destination, IPHONE) for source, destination in mobile_sources("iphone")),
*((source, destination, IPAD) for source, destination in mobile_sources("ipad")),
*((
SCREENSHOTS / "workspace" / f"mac-{locale}.png",
SCREENSHOTS / "workspace" / f"mac-{locale}-framed.png",
CAPTURES / "workspace" / f"mac-{locale}.png",
DEVICE_FRAMES / "workspace" / f"mac-{locale}-framed.png",
MAC,
) for locale in LOCALES),
]
+1 -1
View File
@@ -8,7 +8,7 @@ repository_directory="${script_directory:h}"
derived_data="$repository_directory/.build/mac-marketing-tests"
products="$derived_data/Build/Products"
backup_directory="$repository_directory/.build/screenshot-backups/$(date +%Y%m%d-%H%M%S)"
output_directory="$repository_directory/LandingPage/public/screenshots/workspace"
output_directory="$repository_directory/Marketing/Screenshots/Captures/workspace"
xcodebuild \
-project "$repository_directory/Termind.xcodeproj" \
+1 -1
View File
@@ -5,7 +5,7 @@ setopt typesetsilent
script_directory="${0:A:h}"
repository_directory="${script_directory:h}"
output_directory="$repository_directory/LandingPage/public/screenshots"
output_directory="$repository_directory/Marketing/Screenshots/Captures"
derived_data="$repository_directory/.build/mobile-marketing-screenshots"
marketing_xctestrun="$derived_data/Build/Products/Marketing-TFI.xctestrun"
marketing_scenes="${TERMIND_MARKETING_SCENES:-}"