fix: improve ImageExtractorSample code quality#166
Open
alafleur-genetec wants to merge 4 commits intomainfrom
Open
fix: improve ImageExtractorSample code quality#166alafleur-genetec wants to merge 4 commits intomainfrom
alafleur-genetec wants to merge 4 commits intomainfrom
Conversation
Member
alafleur-genetec
commented
Feb 5, 2026
- 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
Contributor
There was a problem hiding this comment.
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.
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.
…ec/DAP into fix-image-extractor-sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.