Resolução de SEHException e Suporte AVX ao Converter Imagem em Texto com IronOCR
Exceção não tratada: System.Runtime.InteropServices.SEHException

Este problema é comumente encontrado em máquinas que usam processadores Xeon, Celeron, Pentium ou Atom mais antigos que não possuem suporte AVX.
O suporte para processadores sem AVX foi adicionado na versão 2022.8.7804 do IronOcr, portanto, por favor, atualize para uma versão posterior.
// 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
Neste exemplo de código, usamos a propriedade System.Runtime.Intrinsics.X86.Avx.IsSupported para determinar se o processador suporta instruções AVX. Se AVX não for suportado, é aconselhável garantir que você está usando uma versão do IronOcr que inclui suporte para processadores não-AVX.

