Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

37405 Advanced Paste: Image To Text doesn't work with English (Canada) #37806

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cryolithic
Copy link

Summary of the Pull Request

Fix advanced paste failing to create ocrEngine on some English language tags. (en-CA, others)

PR Checklist

Detailed Description of the Pull Request / Additional comments

When attempting to use AdvancedPaste Image to Text, and error was shown with stack trace in logs.

Method GetOCRLanguage compared the current language tag (en-CA) to OcrEngine.AvailableRecognizerLanguages. The returned list on my PC was en-GB, en-US. Both of these should work for OCR against en-CA.

Added check if GetOCRLanguage returned null, call TryCreateFromUserProfileLanguages. In my cases, this succeeds, however I do not know what that behaviour may lead to in other language combinations.

Validation Steps Performed

Built installer
Installed in a fresh vm with language set to en-CA
Attempted Image to Text
OCR was successful

@cryolithic cryolithic force-pushed the 37405-advanced-paste-image-to-text-doesn branch from d6d9e0b to 76617a9 Compare March 6, 2025 22:07
GetOCRLanguage may fail based on language tag not matching (en-CA does not match en-GB or en-US), however user profile language may be valid.
@cryolithic cryolithic force-pushed the 37405-advanced-paste-image-to-text-doesn branch from 76617a9 to c2dfa6f Compare March 6, 2025 22:09
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