Skip to content

feat: export fingerprint image as PNG - #17

Merged
wct097 merged 2 commits into
mainfrom
feature/png-export
Jun 3, 2026
Merged

wct097 merged 2 commits into
mainfrom
feature/png-export

Conversation

@wct097

@wct097 wct097 commented Jun 3, 2026

Copy link
Copy Markdown
Owner

What

Adds File → Export Fingerprint as PNG... (Ctrl+Shift+E) — saves the currently-displayed fingerprint image to a .png via a save dialog.

How

  • The fingerprint is already decoded to an Avalonia WriteableBitmap for display. Export reuses it: bitmap.Save(path) (Skia PNG encode — managed, cross-platform, no native deps).
  • IFileDialogService/FileDialogService gain ShowSaveFileDialogAsync, mirroring the existing open-dialog pattern (SaveFilePickerAsync).
  • ExportPngCommand is gated on an image being present (CanExportPng, re-evaluated via [NotifyCanExecuteChangedFor]); the menu item auto-disables otherwise.

Folded in

Verification & honest gap

  • CI: cross-platform compile (win/macOS/linux) + Core unit suite — the green checks here.
  • Not covered: the project has no headless Avalonia UI-test harness, so the actual save/render path (does the PNG come out correct?) needs a manual smoke-test on your end: open an EFT with a Type-4/14 fingerprint, select it, Export as PNG, confirm the file opens and matches.

🤖 Generated with Claude Code

wct097 and others added 2 commits June 3, 2026 06:59
Adds a "File → Export Fingerprint as PNG..." command (Ctrl+Shift+E) that saves
the currently-displayed fingerprint to a PNG via a save dialog.

- IFileDialogService/FileDialogService: add ShowSaveFileDialogAsync mirroring
  the existing open-dialog pattern (Avalonia SaveFilePickerAsync).
- MainWindowViewModel: ExportPngCommand gated on an image being decoded
  (CanExportPng; re-evaluated via NotifyCanExecuteChangedFor when the bitmap
  changes). Saves the already-decoded WriteableBitmap with Bitmap.Save (Skia
  PNG encode — no native deps, cross-platform).
- MainWindow.axaml: File-menu item; auto-disables when no image is shown.
- README/project_context: check off PNG export; fix stale .NET 8 -> .NET 10
  references in project_context.

Note: export lives in the Avalonia UI layer (the project has no headless UI
test harness), so this is covered by cross-platform compile + the existing
Core suite in CI; the save/render path itself needs a manual smoke-test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- CanExportPng also requires !IsDecodingImage (and _isDecodingImage notifies
  the command) so the menu disables while a decode is in flight.
- ShowSaveFileDialogAsync sets FilePickerSaveOptions.DefaultExtension (derived
  from the first *.ext filter) so bare filenames get .png on Linux/macOS.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@wct097
wct097 merged commit 2542cc3 into main Jun 3, 2026
3 checks passed
@wct097
wct097 deleted the feature/png-export branch June 3, 2026 11:27
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