Library for reading barcodes

288 views
Skip to first unread message

Kenny Meyer

unread,
Aug 13, 2011, 6:01:55 AM8/13/11
to ruby-...@googlegroups.com
Hello,

What library I can use to read barcodes? I am planning to write a Ruby on Rails application which needs to generate barcodes (which is barby for) and needs to read them, too.

Kenny

Ken Collins

unread,
Aug 13, 2011, 8:21:49 AM8/13/11
to ruby-...@googlegroups.com

I have not gotten to the stage where I am actually reading them yet, but did some initial research. Mine was around QRCodes too. I found a few ruby libraries that had deps for python libs that did brunt work. I only found one that was a native ruby solution here.

https://github.com/rubysolo/qrio

Talked to the author a few weeks back and I think this was still a WIP and maybe close to being done. I liked it because it was based off of chunky_png which can be easily speed up using oily_png.

- Ken

Tore Darell

unread,
Aug 13, 2011, 10:57:48 AM8/13/11
to ruby-...@googlegroups.com
I've been thinking about this, and ideally Barby would be able to read as well as create barcodes. Even more ideally, in line with the current barcode/outputter philosophy, it could have "readers" whose only purpose was to parse an image into its representative 'encoding' string and each barcode class would be able to reverse that into data. But I know nothing about reading and interpreting bitmap data and have no idea if it's feasible. I'm not too keen on some halfassed solution that works sometimes with some symbologies with lots of exceptions and shortcomings, which it would be if I were to try it myself..

> --
> You received this message because you are subscribed to the Google Groups "Barby" group.
> To post to this group, send email to ruby-...@googlegroups.com.
> To unsubscribe from this group, send email to ruby-barby+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/ruby-barby?hl=en.
>

Kenny Meyer

unread,
Aug 13, 2011, 1:11:33 PM8/13/11
to ruby-...@googlegroups.com
> I have not gotten to the stage where I am actually reading them yet, but did some initial research. Mine was around QRCodes too. I found a few ruby libraries that had deps for python libs that did brunt work. I only found one that was a native ruby solution here.
>
> https://github.com/rubysolo/qrio
>
> Talked to the author a few weeks back and I think this was still a WIP and maybe close to being done. I liked it because it was based off of chunky_png which can be easily speed up using oily_png.

QRio looks like it's still very alpha and not ready for production usage, yet.

Kenny Meyer

Kenny Meyer

unread,
Aug 13, 2011, 1:23:40 PM8/13/11
to ruby-...@googlegroups.com
> I've been thinking about this, and ideally Barby would be able to read as well as create barcodes. Even more ideally, in line with the current barcode/outputter philosophy, it could have "readers" whose only purpose was to parse an image into its representative 'encoding' string and each barcode class would be able to reverse that into data. But I know nothing about reading and interpreting bitmap data and have no idea if it's feasible. I'm not too keen on some halfassed solution that works sometimes with some symbologies with lots of exceptions and shortcomings, which it would be if I were to try it myself..

IMHO, it makes very much sense that a barcode library also supports
reading barcodes not only generating them.

I have less knowledge about how to write such library from scratch,
and at the current moment I just need to get things done.

Currently there are two actively maintained stable solutions written
in Java (probably more):

- http://code.google.com/p/zxing/
- http://sourceforge.net/projects/zbar/

Zxing makes it needless to buy a barcode scanner. You just use your
Android phone, but I don't have one. (Dammit!)

Zbar makes it possible to use your webcam. I will give that a shot.

Anyway, I can't express you how much more I'd like to use a native
Ruby solution, than fucking around with Java dependencies. I'm still
looking :-)

Thanks for your feedback, guys.

Kenny Meyer

Kenny Meyer

unread,
Aug 13, 2011, 1:27:20 PM8/13/11
to ruby-...@googlegroups.com
> Zxing makes it needless to buy a barcode scanner. You just use your
> Android phone, but I don't have one. (Dammit!)
Pardon me. It also works through an applet.

Kenny Meyer

Phil Ayres

unread,
Aug 13, 2011, 2:20:03 PM8/13/11
to ruby-...@googlegroups.com, ruby-...@googlegroups.com
This is from my experience. I've used zbar command line in my rails projects for a while. It has worked fast and reliably for image reading. I also played with the webcam reader on Linux and Windows, and it seemed to work really well.

Personally, I like the reading being separate from generation. In my solutions I need one or the other, and don't want the overhead of a bunch of unnecessary stuff.

Phil

--
Phil Ayres
617-794-2330


On Aug 13, 2011, at 10:27 AM, Kenny Meyer <knny...@gmail.com> wrote:

>> Zxing makes it needless to buy a barcode scanner. You just use your
>> Android phone, but I don't have one. (Dammit!)
> Pardon me. It also works through an applet.
>
> Kenny Meyer
>
>
>
> On Sat, Aug 13, 2011 at 1:23 PM, Kenny Meyer <knny...@gmail.com> wrote:
>> Zxing makes it needless to buy a barcode scanner. You just use your
>> Android phone, but I don't have one. (Dammit!)
>>
>

Kenny Meyer

unread,
Aug 14, 2011, 1:20:14 PM8/14/11
to ruby-...@googlegroups.com
Is the code from the rails project open-sourced and publicly visible? If yes, can you give me the URL to it? I want to learn more about how you have used zbar in a Rails environment.

Phil Ayres

unread,
Aug 15, 2011, 11:03:57 PM8/15/11
to Barby
Here is a link to a very cut down snippet of how we are using zbar in
the rails project. Cut down, just to make it readable and remove the
junk that wouldn't make sense outside our project:

https://gist.github.com/1146650

All the snippet aims to do is read the barcode, capture its type,
value and whether it contains a URL. We also convert PDFs prior to
reading if necessary, and do this outside this function.

Phil

Kenny Meyer

unread,
Aug 16, 2011, 7:17:19 PM8/16/11
to ruby-...@googlegroups.com
Thank you for sharing the code.

I think, I went with the easiest solution: I bought a barcode scanner with decoder built-in, which costed ~50 US$. I swear, I haven't thought of that they could come with a decoder, which makes barcode reading so trivial... and eliminates my need of a software solution.
Reply all
Reply to author
Forward
0 new messages