Issue 1144 in zxing: add option to decode qr only (patch submission)

12 views
Skip to first unread message

zx...@googlecode.com

unread,
Feb 1, 2012, 6:19:12 PM2/1/12
to zx...@googlegroups.com
Status: New
Owner: ----

New issue 1144 by speed1...@gmail.com: add option to decode qr only (patch
submission)
http://code.google.com/p/zxing/issues/detail?id=1144

I have a patch here that allows the option to scan for qr codes only. This
is helpful because sometimes when scanning an entire page (intending to
find a qr code) a false positive is returned because of the lines elsewhere
on the page (the scanner thinks it found a UPC or other barcode).

I have been using this hack since version 1.6 and after patching the latest
svn rev I thought I'd share.

The qronly.patch is the entire output of 'svn diff' and the other two are
split out versions of the same thing.

Attachments:
qronly.patch 3.8 KB
Config.java.patch 762 bytes
CommandLineRunner.java.patch 3.1 KB

zx...@googlecode.com

unread,
Feb 2, 2012, 4:07:50 AM2/2/12
to zx...@googlegroups.com
Updates:
Labels: Type-Enhancement Priority-Low

Comment #1 on issue 1144 by srowen: add option to decode qr only (patch
submission)
http://code.google.com/p/zxing/issues/detail?id=1144

I think we'd soon have 20 options for all possibilities, how about one new
flag that lets you specify the exact formats you want?

zx...@googlecode.com

unread,
Feb 2, 2012, 10:57:03 AM2/2/12
to zx...@googlegroups.com

Comment #2 on issue 1144 by pintinti...@gmail.com: add option to decode qr

We have no database.

zx...@googlecode.com

unread,
Feb 2, 2012, 11:17:11 AM2/2/12
to zx...@googlegroups.com

Comment #3 on issue 1144 by speed1...@gmail.com: add option to decode qr

I'll see what I can do to get a flag in place. That does sound like a more
elegant option ;)

zx...@googlecode.com

unread,
Feb 28, 2012, 11:09:26 PM2/28/12
to zx...@googlegroups.com

Comment #4 on issue 1144 by speed1...@gmail.com: add option to decode qr

OK, I had time to get this roughed in. It's not as pretty as I'd like,
but I'm not a java pro...

Here's the breakdown.
new option is --barcode_type=
barcode type is specified with the names in the
you can add more than one with a comma(such as
--barcode_type=DATAMATRIX,UPC_A

I wanted to have the options build dynamically based on the string passed
in but for now it's just a series of ifs

I put it in a for loop format to make it easier to accomodate if someone
knows a good way to have it loop through bcTypes[i] inserting the
appropriate vector.add lines

Attachments:
all.patch 5.0 KB
CommandLineRunner.java.patch 4.6 KB
Config.java.patch 821 bytes

zx...@googlecode.com

unread,
Mar 3, 2012, 11:51:21 AM3/3/12
to zx...@googlegroups.com

Comment #5 on issue 1144 by srowen: add option to decode qr only (patch
submission)
http://code.google.com/p/zxing/issues/detail?id=1144

You can make this code much simpler because you can parse a string
like "UPC_A" to the BarcodeFormat object using its valueOf() method.

Surely Config should have one property, a List<BarcodeFormat> rather than
String[], and perhaps call it getBarcodeFormats()?

zx...@googlecode.com

unread,
May 26, 2012, 7:00:19 AM5/26/12
to zx...@googlegroups.com
Updates:
Status: WontFix

Comment #6 on issue 1144 by srowen: add option to decode qr only (patch
submission)
http://code.google.com/p/zxing/issues/detail?id=1144

Closing as WontFix unless there's a follow-up.

Reply all
Reply to author
Forward
0 new messages