MCPcopy Create free account
hub / github.com/Breakthrough/PySceneDetect / render_installer_jpegs

Function render_installer_jpegs

scripts/generate_assets.py:255–284  ·  view source on GitHub ↗

Render the per-scale baseline JPEGs that ship inside the MSI. Outputs `Generated Images/installer_{banner,logo}{,.scale-125,.scale-150,.scale-200}.jpg` from the master SVG. These are gitignored - pre_release.py --release rebuilds them before each MSI build, so they always match the curr

(inkscape: str, work_dir: Path)

Source from the content-addressed store, hash-verified

253
254
255def render_installer_jpegs(inkscape: str, work_dir: Path) -> None:
256 """Render the per-scale baseline JPEGs that ship inside the MSI.
257
258 Outputs `Generated Images/installer_{banner,logo}{,.scale-125,.scale-150,.scale-200}.jpg`
259 from the master SVG. These are gitignored - pre_release.py --release rebuilds
260 them before each MSI build, so they always match the current logo without
261 being re-committed every time.
262 """
263 GENERATED_IMAGES_DIR.mkdir(parents=True, exist_ok=True)
264 # Render the slate at the exact target size each iteration - sharper than
265 # rendering once big and downsampling, and avoids Pillow's resize stub mismatch.
266 for scale, suffix in SCALES:
267 bw, bh = round(BANNER_BASE[0] * scale), round(BANNER_BASE[1] * scale)
268 dw, dh = round(DIALOG_BASE[0] * scale), round(DIALOG_BASE[1] * scale)
269
270 # Banner icon sized off height (the limiting dim - banner is wide & short).
271 # Strip is wider than the icon, so the icon centers within it.
272 banner_icon_side = round(bh * BANNER_ICON_FRAC)
273 slate_fg = _render_slate(inkscape, work_dir, banner_icon_side, inverted=False)
274
275 dialog_strip_w = round(dw * DIALOG_STRIP_FRAC)
276 dialog_icon_side = round(dialog_strip_w * DIALOG_ICON_FRAC)
277 slate_bg = _render_slate(inkscape, work_dir, dialog_icon_side, inverted=True)
278
279 banner_path = GENERATED_IMAGES_DIR / f"installer_banner{suffix}.jpg"
280 dialog_path = GENERATED_IMAGES_DIR / f"installer_logo{suffix}.jpg"
281 print(f" {banner_path.relative_to(REPO_DIR)} ({bw}x{bh})")
282 _save_baseline_jpeg(_compose_banner(slate_fg, (bw, bh)), banner_path)
283 print(f" {dialog_path.relative_to(REPO_DIR)} ({dw}x{dh})")
284 _save_baseline_jpeg(_compose_dialog(slate_bg, (dw, dh)), dialog_path)
285
286
287def render_installer_static(inkscape: str, work_dir: Path) -> None:

Callers 2

pre_release.pyFile · 0.90
mainFunction · 0.85

Calls 4

_render_slateFunction · 0.85
_save_baseline_jpegFunction · 0.85
_compose_bannerFunction · 0.85
_compose_dialogFunction · 0.85

Tested by

no test coverage detected