Sha256: 324b0bbd321686e5337794ca1625fa7fb409cee924f55c867e872420784e719d
Contents?: true
Size: 750 Bytes
Versions: 8
Compression:
Stored size: 750 Bytes
Contents
# Given an image, return an ordered array of detectable barcodes # # class Sqed::Parser::BarcodeParser < Sqed::Parser TYPE = :barcode attr_accessor :image attr_accessor :barcode def initialize(image) super @image = image end def barcode @barcode ||= get_barcode @barcode end # Uses the same enging as zbarimg that you can install with brew (zbarimg) # def get_code_128 nil # ZXing.decode @image.filename end # try a bunch of options, organized by most common, give the first hit def get_barcode [get_code_128].compact.first end #def get_datamatrix # https://github.com/srijan/ruby-dmtx #end # alias to a universal method def text(section_type: :default) barcode end end
Version data entries
8 entries across 8 versions & 1 rubygems