I have been trying to use this code, although I am always getting "Invalid Barcode".
I have generated the Barcode Image - Type 128 using JBars which is available on Site, and want this program to read the image. The code looks as below:
I got the code working. I used a different program to create the Barcode and used EAN13 format.
But there is one problem I am facing.
1. I created a Barcode image and stored it in file system. Then used this program , to read the same Image file generated , and it returned me the exact Barcode. I specified the rectangle Parameter as: rectangle(0,0,img.getWidth(), img.getHeight()).
2. But ideally I would like to put this Image file on a Web Page, which the user will print and Scan. The scanned Page will be saved as JPG file but will contain the Barcode along with other text info. I simulated the same scenario, and generated a Image Page which contains the Barcode along with some other Info.
3. Now I specify the rectangle parameters such that Barcode is within the rectangle, but it always returns "Invalid Barcode". As per my Image Page containing the Barcode, I specified - Rectangle(344,32,160,80) , but does not work. How do we specify the rectangle parameters. ?
-- [How to post any file to the forum ? I would like post my image file, could not file link or button to attach file.]
Thanks again Andi
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, you can't attach to a forum message, so I've opened a bug ([ 1438540 ] Invalid Barcode ) if you would like to attach your image file to that, I'll see what I can do.
Andi
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
A couple of things.
1) you need to set the Rectangle to be arounf the barcode. In this example (92,20,130,84) Should do.
2) you need a good quality scan.The ones provided on the website at a quick glance look ok, but in fact they are of a poor quality. I tried to decode them manually and could not do it.
3) Jpeg is not an ideal format to store barcodes, as they removed some detail. Try to use a lossless compression like PNG or GIF.
I hope this helps
Andi
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
1) Do you think the software can read a large picture?
For example, I have a cell phone Sony Ericsson W800i and I took a picture from barcode, but the camera`s resolution is 2 MegaPixels... then the picture is big, very big.
2) How can I "select" the rectangle exactly around the barcode?
Can you e-mail me or something?
jpgalvagni msn.com
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Many Thanks for this code !!.
I have been trying to use this code, although I am always getting "Invalid Barcode".
I have generated the Barcode Image - Type 128 using JBars which is available on Site, and want this program to read the image. The code looks as below:
----------------------------------------------
barcode = JBarcode_Recognition.GetBarcode(img,
new Rectangle(0, 0, img.getWidth(), img.getHeight()), 0.0,
JBarcode_Recognition.HORIZONTAL,
JBarcode_Recognition.NO_COLOUR_INVERT,
JBarcode_Recognition.NO_DIRECTION_REVERSE, Barcode.BT_CODE_128);
-----------------------------------------------
Any clues why I am getting "Invalid Barcode" error each time.
Thanks
Could you post an image, so I can take a look.
Cheers
Andi
Hey Andi,
Thanks for your reply. !!
I got the code working. I used a different program to create the Barcode and used EAN13 format.
But there is one problem I am facing.
1. I created a Barcode image and stored it in file system. Then used this program , to read the same Image file generated , and it returned me the exact Barcode. I specified the rectangle Parameter as: rectangle(0,0,img.getWidth(), img.getHeight()).
2. But ideally I would like to put this Image file on a Web Page, which the user will print and Scan. The scanned Page will be saved as JPG file but will contain the Barcode along with other text info. I simulated the same scenario, and generated a Image Page which contains the Barcode along with some other Info.
3. Now I specify the rectangle parameters such that Barcode is within the rectangle, but it always returns "Invalid Barcode". As per my Image Page containing the Barcode, I specified - Rectangle(344,32,160,80) , but does not work. How do we specify the rectangle parameters. ?
-- [How to post any file to the forum ? I would like post my image file, could not file link or button to attach file.]
Thanks again Andi
Hi, you can't attach to a forum message, so I've opened a bug ([ 1438540 ] Invalid Barcode ) if you would like to attach your image file to that, I'll see what I can do.
Andi
I am trying to read this barcode below, for example, and I`m having the same problem, Invalid_Barcode_Exception
<img src="http://www.eanbrasil.org.br/html/contentManagement/images/Numeration/barra_ean_13.jpg" alt="Example of EAN-13 Barcode">
I am using this code below to do this reading jog:
_______________________________________________________________
Barcode barcode = JBarcode_Recognition.GetBarcode(getImagem(),
new Rectangle(getImagem().getWidth(), getImagem().getHeight()),
0.25,
JBarcode_Recognition.HORIZONTAL,
JBarcode_Recognition.NO_COLOUR_INVERT,
JBarcode_Recognition.NO_DIRECTION_REVERSE,
Barcode.BT_AUTO);
_______________________________________________________________
Any help would be very good.
Hi Galvagni.
A couple of things.
1) you need to set the Rectangle to be arounf the barcode. In this example (92,20,130,84) Should do.
2) you need a good quality scan.The ones provided on the website at a quick glance look ok, but in fact they are of a poor quality. I tried to decode them manually and could not do it.
3) Jpeg is not an ideal format to store barcodes, as they removed some detail. Try to use a lossless compression like PNG or GIF.
I hope this helps
Andi
1) Do you think the software can read a large picture?
For example, I have a cell phone Sony Ericsson W800i and I took a picture from barcode, but the camera`s resolution is 2 MegaPixels... then the picture is big, very big.
2) How can I "select" the rectangle exactly around the barcode?
Can you e-mail me or something?
jpgalvagni msn.com