Labels

09/07/2009

2D barcodes creator/decoder -- Libdmtx

(2维条码生成/解码软件)



Libdmtx is a 2D barcode, or Data Matrix barcodes, creator and decoder.

it took me a while to install it. here is mainly procedure of installation:

download libdmtx-0.7.0.tar.gz from http://www.libdmtx.org/
$ tar -zxf libdmtx-0.7.0.tar.gz


go to new libdmtx folder
$ ./configure

i got an error message:
checking for MAGICK... no
configure: error: dmtxread/dmtxwrite requires Wand >= 6.2.4
 
that's because i am using ubuntu. alright, i need to install ImageMagick from the source.
download ImageMagick source file, unpacked,
$ ./configure
$ make
$ sudo make install

(edit: I may need this:
$ sudo apt-get install libmagick++-dev
$ sudo apt-get install libgraphicsmagick1-dev
)

i may need to install g++ before install ImageMagick
$ sudo apt-get install g++

got anther error when i ran ./configure:
/usr/bin/ld: cannot find -lperl

ok, need to install libperl
$ sudo apt-get install libperl-dev

then, go back to install ImageMagick, and libdmtx.

all done..



To read a 2D barcode:
$ dmtxread /~/Desktop/image.png  
$ dmtxread -N 1 /home/czhang/mypro/UIM.jpg >> /home/czhang/mypro/UIM.txt
read barcode and export code to text file.

PS: This command will take a while (maybe 5 to 15 seconds) to finish decoding a 2D barcode image.

To speed up decoding, take a look command option. 


To create a 2D barcode:
$ dmtxwrite <(echo -n 2dbarcodecontent) -o image.png


Edit:
get web-cam capture software from here:
http://www.firestorm.cx/fswebcam/

Fedora install:
root$ yum install fswebcam

may need to install GDlib:
http://www.libgd.org/Downloads

take a photo with webcam:
$ fswebcam -F 15 -r 352x288 --no-banner --save /mnt/cdrive/UIM.jpg


1 comment:

  1. Anonymous20/3/11 12:36

    Thank you, just what I was looking for

    ReplyDelete