Method: ZXing.decode!

Defined in:
lib/zxing.rb

.decode!(file) ⇒ Object

Same as decode, but raises an exception when image cannot be decoded.

file should be the path to the image file to decode, as a string.

Example:

path = "./no_encoded_image.png"
ZXing.decode(path) #=> ZXing::UndecodableError


38
39
40
# File 'lib/zxing.rb', line 38

def self.decode!(file)
  Decoder.decode! normalize(file)
end