Free Support Forum - aspose.com

TIFF Barcode recognition

Hi,

I’m unable to get the barcode out of the attached file using the sample code:

ArrayList barcodes = new ArrayList();
Iterator readers = javax.imageio.ImageIO.getImageReadersByFormatName(“tiff”);

try{
if (readers.hasNext()) {

File fi = new File(tiffPath);

ImageInputStream iis = javax.imageio.ImageIO.createImageInputStream(fi);

TIFFDecodeParam param = null;

ImageDecoder dec = ImageCodec.createImageDecoder(“tiff”, fi, param);

//Get the page count of the tiff image

int pageCount = dec.getNumPages();

ImageReader _imageReader = readers.next();

if (_imageReader != null) {

_imageReader.setInput(iis, true);

//Feed each page to the BarCodeReader

for (int i = 0; i < pageCount; i++) {

BufferedImage _bufferedImage = _imageReader.read(i);

File file = new File(“faxpage”+i+".tiff");
ImageIO.write((RenderedImage)_bufferedImage, “tiff”,file );
BarCodeReader reader = new BarCodeReader(_bufferedImage, BarCodeReadType.Code93Standard);

//Read the barcodes in a single page

while (reader.read()){
barcodes.add(reader.getCodeText());
System.out.println(reader.getCodeText());
}

}
}
}
}catch(Exception e){
e.printStackTrace();
}
return barcodes;

Could you please let me know if you are able to read it?

Cheers,
Tim

Hi Tim,

I could not recognize the barcode from the tif file either. I have sent the image to the developers for their analysis and also added this in our bug tracking system (ID: 12525). I will get back to you when there is a feedback or the issue gets resolved. Sorry for the inconvenience.

Hi Tim,

Please find the attached beta jar file, which contains the fix for this issue.

In your code, please use Code39Standard symbolgoy, because the barcode in the image is of type Code39.

The issues you have found earlier (filed as 12525) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.