Closed philister closed 11 years ago
The underlying zbar
library supports configuration values. This isn't currently plumbed into the zbar
gem, but I could add that without too much effort. The API currently allows you to check the symbology
of the resulting ZBar::Symbol
objects:
symbols = image.process
qrcodes = symbols.select { |symbol| symbol.symbology == "qrcode" }
Thank you for this explanation. Currently I "filter" the symbology afterwards (after process). But I bet, the search would be faster, if it had to search for a specific symbology. You know what I mean? Would be great to have this feature, because at least in my case, I know, what symbology I'm looking for.
All right, I'll take a whack at this :-)
Would you happen to have an image containing barcodes with more than one symbology that you'd like to contribute to the test suite?
As of the current master:
> ZBar::Image.from_jpeg(File.open("spec/support/test.jpg", "rb")).process(:symbology => "qrcode")
=> []
> ZBar::Image.from_jpeg(File.open("spec/support/test.jpg", "rb")).process(:symbology => "ean13")
=> [#<ZBar::Symbol:... @symbology="EAN-13", @data="9876543210128", ...>]
I want to do a couple other things first, but this will be released as 0.2.0.
zbar-0.2.0 has been released, containing this functionality, a rewritten test suite, Travis CI, as well as a runtime check for the zbar JPEG issue behind #2.
Wow, awesome! Thank you a lot. It works well und improves the performance of my code-detection significantly.
Hi,
great gem!
Is there a possibility to search only for (lets say) QR-Codes?
Thanks and regards, Phil