Dépannage des exceptions SEHException et de la prise en charge AVX dans le logiciel OCR IronOCR
Ce logiciel OCR peut générer une exception non gérée : System.Runtime.InteropServices.SEHException

Ce problème est fréquemment rencontré sur les machines utilisant d'anciens processeurs Xeon, Celeron, Pentium ou Atom qui ne prennent pas en charge AVX.
La prise en charge des processeurs non-AVX a été ajoutée dans la version 2022.8.7804 d'IronOCR ; veuillez donc effectuer une mise à jour vers une version ultérieure.
// Example: Checking AVX support programmatically in C#
using System;
class ProcessorFeatures
{
// Main method to check AVX support
static void Main()
{
// Check if the machine's processor supports AVX
if (IsAvxSupported())
{
Console.WriteLine("AVX is supported.");
}
else
{
Console.WriteLine("AVX is not supported. Consider updating IronOcr to the latest version that supports non-AVX processors.");
}
}
// Function to determine if AVX is supported
static bool IsAvxSupported()
{
return System.Runtime.Intrinsics.X86.Avx.IsSupported;
}
}
// Example: Checking AVX support programmatically in C#
using System;
class ProcessorFeatures
{
// Main method to check AVX support
static void Main()
{
// Check if the machine's processor supports AVX
if (IsAvxSupported())
{
Console.WriteLine("AVX is supported.");
}
else
{
Console.WriteLine("AVX is not supported. Consider updating IronOcr to the latest version that supports non-AVX processors.");
}
}
// Function to determine if AVX is supported
static bool IsAvxSupported()
{
return System.Runtime.Intrinsics.X86.Avx.IsSupported;
}
}
' Example: Checking AVX support programmatically in C#
Imports System
Friend Class ProcessorFeatures
' Main method to check AVX support
Shared Sub Main()
' Check if the machine's processor supports AVX
If IsAvxSupported() Then
Console.WriteLine("AVX is supported.")
Else
Console.WriteLine("AVX is not supported. Consider updating IronOcr to the latest version that supports non-AVX processors.")
End If
End Sub
' Function to determine if AVX is supported
Private Shared Function IsAvxSupported() As Boolean
Return System.Runtime.Intrinsics.X86.Avx.IsSupported
End Function
End Class
Dans cet exemple de code, nous utilisons la propriété System.Runtime.Intrinsics.X86.Avx.IsSupported pour déterminer si le processeur prend en charge les instructions AVX. Si AVX n'est pas pris en charge, il est conseillé de s'assurer que vous utilisez une version d'IronOcr qui inclut la prise en charge des processeurs non-AVX.

