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

Function render_installer_static

scripts/generate_assets.py:287–326  ·  view source on GitHub ↗

Render the stable, committed installer assets - only re-run when the logo changes. Outputs: - psd_square_small.ico (copy of pyscenedetect.ico) - installer_banner.png, installer_logo.png (top-level audit masters) - installer_banner.svg, installer_logo.svg (top-level + Generated

(inkscape: str, work_dir: Path)

Source from the content-addressed store, hash-verified

285
286
287def render_installer_static(inkscape: str, work_dir: Path) -> None:
288 """Render the stable, committed installer assets - only re-run when the logo changes.
289
290 Outputs:
291 - psd_square_small.ico (copy of pyscenedetect.ico)
292 - installer_banner.png, installer_logo.png (top-level audit masters)
293 - installer_banner.svg, installer_logo.svg (top-level + Generated Images/, master SVG copies)
294 """
295 GENERATED_IMAGES_DIR.mkdir(parents=True, exist_ok=True)
296
297 top_banner = INSTALLER_DIR / "installer_banner.png"
298 top_dialog = INSTALLER_DIR / "installer_logo.png"
299 tbw, tbh = TOP_LEVEL_BANNER_PNG_SIZE
300 tdw, tdh = TOP_LEVEL_DIALOG_PNG_SIZE
301 top_slate_fg = _render_slate(inkscape, work_dir, round(tbh * BANNER_ICON_FRAC), inverted=False)
302 top_dialog_strip = round(tdw * DIALOG_STRIP_FRAC)
303 top_slate_bg = _render_slate(
304 inkscape, work_dir, round(top_dialog_strip * DIALOG_ICON_FRAC), inverted=True
305 )
306 print(f" {top_banner.relative_to(REPO_DIR)} ({tbw}x{tbh})")
307 _compose_banner(top_slate_fg, TOP_LEVEL_BANNER_PNG_SIZE).save(top_banner, "PNG")
308 print(f" {top_dialog.relative_to(REPO_DIR)} ({tdw}x{tdh})")
309 _compose_dialog(top_slate_bg, TOP_LEVEL_DIALOG_PNG_SIZE).save(top_dialog, "PNG")
310
311 # SVG references: drop a copy of the master logo+bg SVG at every spot the
312 # repo previously kept a reference rendering. These aren't read at MSI build
313 # time (the JPGs are what ship); they exist as audit artifacts.
314 for dest in (
315 INSTALLER_DIR / "installer_banner.svg",
316 INSTALLER_DIR / "installer_logo.svg",
317 GENERATED_IMAGES_DIR / "installer_banner.svg",
318 GENERATED_IMAGES_DIR / "installer_logo.svg",
319 ):
320 shutil.copy2(LOGO_BG_SVG, dest)
321 print(f" {dest.relative_to(REPO_DIR)} <- {LOGO_BG_SVG.name}")
322
323 # ARP product icon: reuse pyscenedetect.ico under the filename the .aip
324 # references (line 17: ARPPRODUCTICON psd_square_small).
325 shutil.copy2(ICO_PATH, ARP_ICO_PATH)
326 print(f" {ARP_ICO_PATH.relative_to(REPO_DIR)} <- {ICO_PATH.name}")
327
328
329def render_all_sizes(inkscape: str, work_dir: Path) -> list[Image.Image]:

Callers 1

mainFunction · 0.85

Calls 4

_render_slateFunction · 0.85
_compose_bannerFunction · 0.85
_compose_dialogFunction · 0.85
saveMethod · 0.80

Tested by

no test coverage detected