Method: ZXing.decode
- Defined in:
- lib/zxing.rb
.decode(file) ⇒ Object
Decodes barcodes from an image file
file should be the path to the image file to decode, as a string.
Example:
path = "path/to/file.png"
ZXing.decode(path) #=> "Encoded text"
When the image cannot be decoded, decode returns nil:
path = "./no_encoded_image.png"
ZXing.decode(path) #=> nil
24 25 26 |
# File 'lib/zxing.rb', line 24 def self.decode(file) Decoder.decode normalize(file) end |