Skip to content

fix: improve ImageExtractorSample code quality#166

Open
alafleur-genetec wants to merge 4 commits intomainfrom
fix-image-extractor-sample
Open

fix: improve ImageExtractorSample code quality#166
alafleur-genetec wants to merge 4 commits intomainfrom
fix-image-extractor-sample

Conversation

@alafleur-genetec
Copy link
Member

  • Add proper component unregistration in SampleModule.Unload()
  • Add error handling with MessageBox in SampleImageExtractor
  • Fix VCardReader to correctly extract FirstName from N: field
  • Make photo regex more flexible for different vCard formats

- Add proper component unregistration in SampleModule.Unload()
- Add error handling with MessageBox in SampleImageExtractor
- Fix VCardReader to correctly extract FirstName from N: field
- Make photo regex more flexible for different vCard formats
Copy link
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

This PR enhances the ImageExtractorSample code by improving resource management, error handling, and vCard parsing robustness. The changes add proper component lifecycle management, graceful error handling for file operations, and correct parsing of vCard name fields according to the standard format.

Changes:

  • Add component unregistration in module cleanup to properly manage resources
  • Implement error handling with user feedback when vCard file reading fails
  • Fix vCard name parsing to correctly extract FirstName and LastName from the N: field

Reviewed changes

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

File Description
SampleModule.cs Stores image extractor reference and implements proper component unregistration in Unload()
SampleImageExtractor.cs Adds try-catch error handling with MessageBox feedback and improves variable naming
VCardReader.cs Fixes FirstName/LastName extraction from N: field and makes photo regex more flexible for different vCard formats

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

alafleur-genetec and others added 3 commits February 6, 2026 09:24
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Simplified the image extraction method by removing the try-catch block and MessageBox error notification when reading vCard files. Now, exceptions are not caught within the method, and the result is returned directly. Also adjusted using directives for clarity.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant