Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Text-Grab-Package/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<Identity
Name="40087JoeFinApps.TextGrab"
Publisher="CN=153F3B0F-BA3D-4964-8098-71AC78A1DF6A"
Version="4.9.4.0" />
Version="4.9.5.0" />

<Properties>
<DisplayName>Text Grab</DisplayName>
Expand Down
2 changes: 1 addition & 1 deletion Text-Grab/Text-Grab.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
<EnableMsixTooling>false</EnableMsixTooling>
<Version>4.9.4</Version>
<Version>4.9.5</Version>
</PropertyGroup>

<ItemGroup>
Expand Down
8 changes: 8 additions & 0 deletions Text-Grab/Utilities/WindowsAiUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Microsoft.Windows.AI.Imaging;
using System;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using Text_Grab.Extensions;
Expand All @@ -19,6 +20,13 @@
if (!AppUtilities.IsPackaged() || OSInterop.IsWindows10())
return false;

// Today, Windows AI Text Recognition is only supported on ARM64
Architecture arch = RuntimeInformation.ProcessArchitecture;
if (arch != Architecture.Arm64)
return false;

// After checking for Arm64 the remainder checks should be good to catch supporting devices

try
{
AIFeatureReadyState readyState = TextRecognizer.GetReadyState();
Expand All @@ -32,7 +40,7 @@
#if DEBUG
throw;
#endif
return false;

Check warning on line 43 in Text-Grab/Utilities/WindowsAiUtilities.cs

View workflow job for this annotation

GitHub Actions / build

Unreachable code detected

Check warning on line 43 in Text-Grab/Utilities/WindowsAiUtilities.cs

View workflow job for this annotation

GitHub Actions / build

Unreachable code detected

Check warning on line 43 in Text-Grab/Utilities/WindowsAiUtilities.cs

View workflow job for this annotation

GitHub Actions / build

Unreachable code detected

Check warning on line 43 in Text-Grab/Utilities/WindowsAiUtilities.cs

View workflow job for this annotation

GitHub Actions / build

Unreachable code detected

Check warning on line 43 in Text-Grab/Utilities/WindowsAiUtilities.cs

View workflow job for this annotation

GitHub Actions / build

Unreachable code detected

Check warning on line 43 in Text-Grab/Utilities/WindowsAiUtilities.cs

View workflow job for this annotation

GitHub Actions / build

Unreachable code detected

Check warning on line 43 in Text-Grab/Utilities/WindowsAiUtilities.cs

View workflow job for this annotation

GitHub Actions / build

Unreachable code detected

Check warning on line 43 in Text-Grab/Utilities/WindowsAiUtilities.cs

View workflow job for this annotation

GitHub Actions / build

Unreachable code detected

Check warning on line 43 in Text-Grab/Utilities/WindowsAiUtilities.cs

View workflow job for this annotation

GitHub Actions / build

Unreachable code detected

Check warning on line 43 in Text-Grab/Utilities/WindowsAiUtilities.cs

View workflow job for this annotation

GitHub Actions / build

Unreachable code detected

Check warning on line 43 in Text-Grab/Utilities/WindowsAiUtilities.cs

View workflow job for this annotation

GitHub Actions / build

Unreachable code detected
}
}

Expand Down
6 changes: 4 additions & 2 deletions Text-Grab/Views/FullscreenGrab.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -422,8 +422,6 @@ private static async Task LoadOcrLanguages(ComboBox languagesComboBox, bool usin

count++;
}
if (languagesComboBox.SelectedIndex == -1)
languagesComboBox.SelectedIndex = 0;
}

IReadOnlyList<Language> possibleOCRLanguages = OcrEngine.AvailableRecognizerLanguages;
Expand All @@ -444,6 +442,10 @@ private static async Task LoadOcrLanguages(ComboBox languagesComboBox, bool usin

count++;
}

// if no lang is set, select the first one
if (languagesComboBox.SelectedIndex == -1)
languagesComboBox.SelectedIndex = 0;
}

private void NewEditTextMenuItem_Click(object sender, RoutedEventArgs e)
Expand Down
2 changes: 1 addition & 1 deletion build-unpackaged.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dotnet publish "$PSScriptRoot\$Project\$Project.csproj" `
-v minimal `
-o $BuildPathX64 `
-p:EnableMsixTooling=true `
-p:PublishReadyToRun=true `
-p:PublishReadyToRun=false `
-p:PublishSingleFile=true `
-p:CopyOutputSymbolsToPublishDirectory=false `
--nologo
Expand Down
Loading