Method: ZXing.decode_all
- Defined in:
- lib/zxing.rb
.decode_all(file) ⇒ Object
Decodes barcodes from an image file, and returns an array of encoded values.
file should be the path to the image file to decode, as a string.
Example:
path = "path/to/file.png"
ZXing.decode_all(path) #=> ["First encoded text","Second encoded text"]
When the image cannot be decoded, decode_all returns nil:
path = "./no_encoded_image.png"
ZXing.decode_all(path) #=> nil
58 59 60 |
# File 'lib/zxing.rb', line 58 def self.decode_all(file) Decoder.decode_all normalize(file) end |