Skip to content

fix: restore per-project vCard files#179

Open
alafleur-genetec wants to merge 4 commits into
mainfrom
fix/restore-vcard-per-project
Open

fix: restore per-project vCard files#179
alafleur-genetec wants to merge 4 commits into
mainfrom
fix/restore-vcard-per-project

Conversation

@alafleur-genetec
Copy link
Copy Markdown
Member

@alafleur-genetec alafleur-genetec commented May 15, 2026

Summary

  • Restore VCard and VCardReader as sample-local files for ImageExtractorSample so the current main branch build no longer depends on shared WPF-specific source items.
  • Keep the vCard parsing types under Genetec.Dap.CodeSamples with the standard sample header.
  • Improve the restored parser to avoid field-name overmatching, support additional image formats, and report expected photo parsing failures to Console.Error.
  • Mirror the restored vCard files into CardholderFieldsExtractorSample so both Workspace samples compile with their own local copies.

PR #168 moved VCard.cs and VCardReader.cs into Samples/Shared/ and
registered them in Shared.projitems, which is imported by every
sample project. The two files reference System.Windows.Media.ImageSource
(WPF), but ~80 console-style sample projects don't reference WPF
assemblies, causing 506 build errors on main.

Restoring the pre-#168 layout:
- VCard.cs and VCardReader.cs moved back into CardholderFieldsExtractorSample
- Copies restored in ImageExtractorSample (the second consumer)
- Removed the two VCard entries from Shared.projitems

Both consumer projects are SDK-style csprojs that auto-include *.cs at
the project root, so no csproj edits are needed.

Verified locally: VCard/ImageSource compile errors go from 506 to 0.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

The PR fixes a broken main build by removing the shared VCard.cs / VCardReader.cs entries from Samples/Shared/Shared.projitems and adding per-project copies of both files into ImageExtractorSample and CardholderFieldsExtractorSample. The intent is to make each sample self-contained so the shared-project reference no longer breaks compilation. Note: the PR description only mentions ImageExtractorSample, but the diff also adds the same two files to CardholderFieldsExtractorSample.

Changes:

  • Removed VCard.cs and VCardReader.cs from the shared project items.
  • Added per-project VCard and VCardReader to ImageExtractorSample.
  • Added an identical per-project VCard and VCardReader to CardholderFieldsExtractorSample.

Reviewed changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Samples/Shared/Shared.projitems Drops the shared compile entries for VCard.cs / VCardReader.cs.
Samples/Workspace SDK/ImageExtractorSample/VCard.cs Adds the local VCard data model (proper header + namespace).
Samples/Workspace SDK/ImageExtractorSample/VCardReader.cs Adds the vCard parser; missing standard header/namespace, has regex and format-coverage issues.
Samples/Workspace SDK/CardholderFieldsExtractorSample/VCard.cs Verbatim duplicate of the ImageExtractorSample copy.
Samples/Workspace SDK/CardholderFieldsExtractorSample/VCardReader.cs Verbatim duplicate of the ImageExtractorSample copy; same issues apply.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Samples/Workspace SDK/ImageExtractorSample/VCardReader.cs Outdated
Comment thread Samples/Workspace SDK/ImageExtractorSample/VCardReader.cs Outdated
Comment thread Samples/Workspace SDK/ImageExtractorSample/VCardReader.cs Outdated
Comment thread Samples/Workspace SDK/ImageExtractorSample/VCardReader.cs Outdated
alafleur-genetec and others added 3 commits May 15, 2026 13:39
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Builds on the Copilot autofix commits (regex anchor, broader photo
patterns) and applies the two findings the autofix did not handle:

- Add copyright header and place VCardReader in the
  Genetec.Dap.CodeSamples namespace. Was in the global namespace,
  inconsistent with the companion VCard class and the rest of the
  codebase.
- Narrow the photo-decode catch to FormatException, IOException,
  and NotSupportedException, and log failures to Console.Error
  instead of silently returning null. Sample users can now see why
  a photo did not load.

Mirrored to the second copy of VCardReader.cs in
CardholderFieldsExtractorSample so both consumers stay byte-identical.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

Comment thread Samples/Workspace SDK/ImageExtractorSample/VCard.cs
@alafleur-genetec alafleur-genetec added the bug Something isn't working label May 15, 2026
@alafleur-genetec alafleur-genetec changed the title fix: restore per-project VCard files to fix broken main build fix: restore per-project vCard files May 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Development

Successfully merging this pull request may close these issues.

2 participants