Skip to content

fix(dashboard): embed logo as base64 data URI for portable HTML output#64

Merged
jakehildreth merged 1 commit into
mainfrom
fix/dashboard-logo-base64
May 12, 2026
Merged

fix(dashboard): embed logo as base64 data URI for portable HTML output#64
jakehildreth merged 1 commit into
mainfrom
fix/dashboard-logo-base64

Conversation

@jakehildreth
Copy link
Copy Markdown
Owner

Summary

The dashboard HTML was embedding the logo as an absolute local filesystem path (src="C:\Users\...\Images\Locksmith2.png"), making the output non-portable — the image would not render on any machine other than the one that generated the report.

Changes

  • Resolve logo path candidates as before (module base → source-tree fallback)
  • On first match, read the PNG bytes with [System.IO.File]::ReadAllBytes and encode via [System.Convert]::ToBase64String
  • Pass the resulting data:image/png;base64,... URI as the image source instead of the file path
  • Removed -DisableCache from New-HTMLImage (not applicable to data URIs)
  • Bumped ModuleVersion to 2026.5.121323

Result

Dashboard HTML files are now fully self-contained — the logo renders correctly when opened on any machine, sent via email, or archived.

Testing

  • Built module and ran Invoke-Locksmith2; New-LS2Dashboard
  • Confirmed generated HTML contains src="data:image/png;base64,..." instead of a filesystem path

- replace \ (absolute filesystem path) with \ (data URI)
- base64-encode PNG bytes via [System.IO.File]::ReadAllBytes + [System.Convert]::ToBase64String
- logo resolution candidates unchanged; encoding happens inside the loop on first match
- drop -DisableCache from New-HTMLImage (irrelevant for data URIs)
- bump ModuleVersion to 2026.5.121323
@jakehildreth jakehildreth merged commit 002f9f5 into main May 12, 2026
1 check passed
@jakehildreth jakehildreth deleted the fix/dashboard-logo-base64 branch May 13, 2026 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant