File: test.rb

package info (click to toggle)
libdmtx 0.7.2-2%2Bbuild1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 3,676 kB
  • sloc: sh: 10,371; ansic: 10,144; cs: 596; makefile: 204; java: 161; objc: 157; python: 125; perl: 28; php: 18; ruby: 16
file content (16 lines) | stat: -rwxr-xr-x 298 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/env ruby
require 'rubygems'
require 'RMagick'

require 'Rdmtx'

rdmtx = Rdmtx.new

if ARGV[0]
  image = Magick::Image.read(ARGV[0]).first
  puts "The image contains : "
  puts rdmtx.decode(image, 0)
else
  rdmtx.encode("Hello you !!").write("output.png")
  puts "Written output.png"
end