Hi,
I came across an issue with barcode recognition using Aspose.BarCodeRecognition library. I have a code (see vb.net example below) that is iterating through a TIFF image frames and recognizing barcodes (QR codes actually) on every frame. Usually it works fine, but sometimes it fails with the NullReference exception below.
What is very unpleasant is that it makes the application to crash completely, try-catch block does not help. The exception below has been retrieved from the system windows application log.
Any experience or help with this is welcome!
thanks
Jiri Matejka
------
Code (simplified):
‘Bitmap is a System.Drawing.Image instnance
Dim rd As Aspose.BarCodeRecognition.BarCodeReader = Nothing
Try
rd = New Aspose.BarCodeRecognition.BarCodeReader(Bitmap, ReadType)
rd.Timeout = 2500
rd.SetHints(RecognitionHints.ImageBinarizationHints.MedianSmoothing Or
RecognitionHints.ImageBinarizationHints.Grayscale Or
RecognitionHints.ScanStrengthHints.Strong)
Success = rd.Read()
Catch ex As System.Exception
’ exception is logged here
Return False
End Try
Dim CodeText As String
Try
CodeText = rd.GetCodeText
Catch ex As Exception
return False
’ exception logged here
End Try
-------
Exception
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
Stack:
at Aspose.BarCodeRecognition.٪.ڣ(System.Object)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading._TimerCallback.PerformTimerCallback(System.Object)