Skip to content

Image viewer doubles memory via base64 encoding — consider file:// protocol #64

@khang859

Description

@khang859

Context

PR #60 added the ImageViewerPane which loads images via FILE_READ_BINARY IPC (reads file as Buffer → base64 string → blob URL).

Issue

Base64 encoding increases the data size by ~33%, and the full image is held in memory twice (once as base64 string, once as the decoded blob). For large images (e.g., 20MB PNGs), this could cause noticeable memory pressure.

Suggested fix

Consider using Electron's file:// protocol directly for image src URLs instead of reading through IPC. This would avoid the base64 round-trip entirely and let Chromium handle the file loading natively. May need CSP adjustments.

From PR #60 review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions