We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

BarCode Reader getting hungup on non-barcode images

I’m trying to use the barcode reader to read various files in a directory and find the ones that have barcodes in it but it gets hung up on some files that don’t have barcodes and never comes back from the BarCodeReader.read call.

Here’s a file that it’s getting hung up on:


Here’s the code that I’m using to read it:

using (BarCodeReader reader = new BarCodeReader(fi.Directory.FullName + @"" + fi.Name, BarCodeReadType.Code39Extended))
if (reader.Read())
Response.Write("Barcode Found: " + reader.GetCodeText() + “
MyDebug.Add("Barcode Found: " + reader.GetCodeText());
int inventoryId = -1;
if (!Int32.TryParse(reader.GetCodeText(), out inventoryId))

Please let me know what I need to do. Thanks, Steve

Hi Steve,

Thank you for contacting support. We have tested your sample graphic against the latest build of Aspose.BarCode for .NET version 6.5.0. The read method is taking 20 seconds in execution mode. Please check using the latest version of Aspose.BarCode 6.5.0 and let us know how it goes on your side.

Thank you. I tried the new library and it appears to be working. If I have any other issues I’ll let you know. I take it that my license from my previous version will work with this version as well…

Hi Steve,

Thank you for updating us. It is nice to hear from you that the problem has been solved. Please feel free to reply us if you have any other question regarding Aspose APIs, we will be happy to help you.

We are now having an issue with this image. I am using 6.5.0 as suggested: http://www.goldinauctions.com/UserUploads/Upload19/12564_GLD1757.jpg

Hi Steve,

Thank you for sharing a sample image. For this image, the read method is hardly taking 3 to 4 seconds in execution mode and does not recognize any barcode. It is a correct behavior because there is no barcode on the image. We hope, this helps.

For us the application is getting hung up in the read method. We realize there is no barcode in the image but it doesn’t seem to ever stop trying to read it. What do you mean by execution mode?

Hi Steve,

Thank you for your inquiry. We’re working over your query and will get back to you soon.

Hi Steve,

Thank you for being patient. We have tested your sample image using the source code below:


string filePath = @“C:\temp\12564_GLD1757.jpg”;<o:p></o:p>

BarCodeReader reader = new BarCodeReader(filePath, BarCodeReadType.Code39Extended);

Stopwatch stopWatch = new Stopwatch();


while (reader.Read())



Console.WriteLine("barcode has been detected");


Console.WriteLine("Time: " + stopWatch.ElapsedMilliseconds);



debug mode:
Time: 1713

Exe mode:
Time: 1153
[quote user=“Steve Freedman”]
What do you mean by execution mode?
We have an exe file in Project/bin/release/Debug and it runs on a computer without Visual Studio. However, C#/VB express software must be installed in it. Please refer to the Microsoft help topic:

In case it does not help, then please also provide us other environment details where it fails, i.e. Operating System (edition, 32 or 64 bit, language), Visual Studio (edition, build id etc). We need to be more specific. We’ll investigate this issue at our end and guide you accordingly.