Free Support Forum - aspose.com

BarCodeReader: Timeout is not working

Hi,
Timeout is not working.
This is my code:

In pom:

com.aspose
aspose-barcode
20.9

In Java:
BarCodeReader reader = new BarCodeReader();
reader.setBarCodeImage(<stringFilename, where file=.tiff-format>);
reader.setQualitySettings(QualitySettings.getNormalQuality());
reader.setBarCodeReadType(DecodeType.ALL_SUPPORTED_TYPES);

//Set timeout in milliseconds
reader.setTimeout(1000604); //1000604=4 minutes
logger.info(“BarcodeService->getBarcodes->getTimeout=”+reader.getTimeout());

BarCodeResult[] barCodeResult=null;

try {
barCodeResult=reader.readBarCodes();
}
catch (Exception exception){
barCodeResult=null;
throw new Exception ("Barcodeservices->BarcodeService->getBarcodes: Exception: "+exception.getMessage()) ;
}
finally {
reader=null;
}

I also tried with “reader.setTimeout(60);” to be sure that it doesn’t work.

It just continues till the end of recognition.

Am i doing something wrong, or is this a (known) bug?

Thanks,

Odon

The layout of this topic is a little “messed-up”.
What is really there, is reader.setTimeout(1000604); //100060 4=4 minutes

so reader.setTimeout(240000);

@Odon_Schoofs,

After an initial test, I am able to reproduce the issue as you mentioned. It seems that BarCodeReader.setTimeout() method is not working properly. It just continues to process till the end of recognition code. I tested it using a sample TIFF file and found the issue. I have logged a ticket with an id “BARCODEJAVA-1048” for your issue. We will look into it soon.

Once we have an update on it, we will let you know.