forked from dmtx/dmtx-wrappers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
325 lines (244 loc) · 10.4 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
=================================================================
libdmtx - Open Source Data Matrix Software
=================================================================
libdmtx README file (all platforms)
This summary of the libdmtx package applies generally to all
platforms. For instructions regarding your specific platform
please also read the README.xxx file in this directory that
matches your system (e.g., README.linux, README.cygwin,
README.osx, README.visualc, etc...).
1. Introduction
-----------------------------------------------------------------
libdmtx is a software library that enables programs to read and
write Data Matrix barcodes of the modern ECC200 variety. The
library runs natively on several platforms, and can be accessed
by multiple languages using the libdmtx language wrappers. The
utility programs dmtxread and dmtxwrite provide a command line
interface for libdmtx, and serve as a good reference for
developers writing their own libdmtx-enabled programs.
2. Package Components
-----------------------------------------------------------------
libdmtx serves a diverse audience and contains many components,
some of which may not be useful to you. Components fall into one
of four categories:
* Core library (useful to all libdmtx users)
* Utility programs (useful to command line users)
* Test programs (useful to libdmtx developers)
* Language Wrappers (useful to non-C/C++ developers)
The default installation will compile and install the core
library and all three command line utilities. The test programs
are compiled by running an additional "make check", and the
language wrappers are built using instructions found in their
specific directories.
Users who only want the core library can disable the command line
utilities by passing the following parameters to "configure"
during installation:
--disable-dmtxread --disable-dmtxwrite --disable-dmtxquery
This eliminates most software dependencies and helps to reduce
compile times. However, these utilities provide a convenient way
to test the library and to learn its behavior, so their inclusion
is recommended if possible.
Appendix A. at the end of this file provides a full list of the
package components and their properties.
3. Installation
-----------------------------------------------------------------
libdmtx uses GNU Autotools so installation should be familiar to
veterans of free software. If your platform cannot easily run the
Autotools scripts (e.g., MS Visual Studio) then refer to the
appropriate platform-specific README.xxx located in this
directory for alternate instructions.
In theory the following 3 steps will compile and install libdmtx
on your system:
$ ./configure
$ make
$ sudo make install
However, you may need to install additional software for these
steps to work properly. Details are provided below to handle
error messages or if you want to customize beyond the defaults.
Details on "configure" step
----------------------------------------
If you obtained libdmtx from Subversion you may have received an
error like "./configure: No such file or directory". Run this
command and try again:
$ ./autogen.sh
The autogen.sh command requires autoconf, automake, libtool, and
pkgconfig to be installed on your system.
The configure script offers many options for customizing the
build process, many of which are described in the INSTALL file in
this directory. If the INSTALL file does not exist then you may
need to run the "./autogen.sh" step first. Examples of common
customizations include:
$ ./configure CC=/usr/local2/bin/gcc
$ ./configure --prefix=/your/custom/path
$ ./configure --disable-dmtxread --disable-dmtxwrite
Details on "make" step
----------------------------------------
Errors encountered during the "make" step are often a result of
missing software dependencies. These dependencies are listed in
Appendix A. of this file. Install any missing software and try
again.
Details on "sudo make install" step
----------------------------------------
If the 'sudo' command is not configured on your system then
alternatively you can yell "Yeeehaww!" as you log in as root and
run this instead:
$ make install
And finally...
----------------------------------------
If you want to verify that everything is working properly you can
optionally build the test programs like this:
$ make check
This command will not perform any tests, but will build the
programs that contain test logic: multi_test, rotate_test,
simple_test, and unit_test.
Note: multi_test and rotate_test contain extra dependencies due
to their graphical nature, and are not terribly useful unless you
need to test the library's internals.
4. Basic Usage
-----------------------------------------------------------------
New users are encouraged to read the man pages for the library
and command line utilities. However, here are a few simple cases
to get you started:
The dmtxwrite utility turns a message into a barcode image. The
message is passed to dmtxwrite via file or standard input, and
the output image is written to file or standard output. The
following examples all produce an equivalent result:
$ echo -n 123456 | dmtxwrite > image.png
$ echo -n 123456 | dmtxwrite -o image.png
$ echo -n 123456 > mesg.txt; dmtxwrite mesg.txt > image.png
$ dmtxwrite <(echo -n 123456) -o image.png
Conversely, the dmtxread utility turns barcode images back into
messages. Images are passed to dmtxread via standard input or
file, and the output is written to standard output. The following
examples will produce an equivalent result:
$ dmtxread -n image.png
$ cat image.png | dmtxread -n
Other typical cases:
$ dmtxread -n -N1 image1.png image2.png image3.png
$ dmtxread -n -N1 -m500 image.png
You can even combine the utilities like this:
$ echo 'Hello, world!' | dmtxwrite | dmtxread
Hello, world!
$ dmtxread image1.png | dmtxwrite -o image2.png
Note: In this example the barcode in image2.png might appear
different than the one in image1.png. Both barcodes will encode
the same message, but the overall barcode shape and its internal
bit pattern might be different.
5. Contact
-----------------------------------------------------------------
Project website: http://www.libdmtx.org
Documentation wiki: http://libdmtx.wikidot.com
SourceForge.net page: http://www.sourceforge.net/projects/libdmtx
OhLoh.net page: https://www.ohloh.net/projects/libdmtx
Open mailing list: [email protected]
6. This Document
-----------------------------------------------------------------
This document is derived from the wiki page located at:
http://libdmtx.wikidot.com/general-instructions
If you find an error or have additional helpful information,
please edit the wiki directly with your updates.
Appendix A. Full Listing of libdmtx Components
-----------------------------------------------------------------
Name: libdmtx
Type: Core library
Description: Data Matrix encoding/decoding logic
Location: libdmtx
Build: make
Requires: No dependencies
-----------------------------------
Name: dmtxread
Type: Utility program
Description: Read Data Matrix barcodes from the command line
Location: libdmtx/util/dmtxread
Build: make
Requires: ImageMagick
Disable: ./configure --disable-dmtxread
-----------------------------------
Name: dmtxwrite
Type: Utility program
Description: Create Data Matrix barcodes from the command line
Location: libdmtx/util/dmtxwrite
Build: make
Requires: ImageMagick
Disable: ./configure --disable-dmtxwrite
-----------------------------------
Name: dmtxquery
Type: Utility program (currently non functional)
Description: Query and merge scan results from dmtxread utility
Location: libdmtx/util/dmtxquery
Build: make
Requires: No dependencies
Disable: ./configure --disable-dmtxquery
-----------------------------------
Name: libdmtx Cocoa wrapper
Type: Language wrapper
Description: libdmtx Cocoa wrapper
Location: libdmtx/wrapper/cocoa
Build: See INSTALL file in libdmtx/wrapper/cocoa directory
Requires: OS X
Disable: Not included in default build
-----------------------------------
Name: libdmtx Java wrapper
Type: Language wrapper
Description: libdmtx Java wrapper
Location: libdmtx/wrapper/java
Build: See INSTALL file in libdmtx/wrapper/java directory
Requires: java
Disable: Not included in default build
-----------------------------------
Name: libdmtx-php
Type: Language wrapper
Description: PHP libdmtx wrapper
Location: libdmtx/wrapper/php
Build: See INSTALL file in libdmtx/wrapper/php directory
Requires: php, php-cli, php-common
Disable: Not included in default build
-----------------------------------
Name: pydmtx
Type: Language wrapper
Description: Python libdmtx wrapper
Location: libdmtx/wrapper/python
Build: See INSTALL file in libdmtx/wrapper/python directory
Requires: python, pil
Disable: Not included in default build
-----------------------------------
Name: libdmtx-ruby
Type: Language wrapper
Description: Ruby libdmtx wrapper
Location: libdmtx/wrapper/ruby
Build: See INSTALL file in libdmtx/wrapper/ruby directory
Requires: ruby, RMagick
Disable: Not included in default build
-----------------------------------
Name: multi_test
Type: test program
Description: Graphical program for visualizing scan behavior
Location: libdmtx/test/multi_test
Build: make check
Requires: SDL, SDL_image
Disable: Not included in default build
-----------------------------------
Name: rotate_test
Type: test program
Description: Scan simulated camera input from OpenGL in realtime
Location: libdmtx/test/rotate_test
Build: make check
Requires: mesa-libGL, mesa-libGLU, SDL, libpng
Disable: Not included in default build
-----------------------------------
Name: simple_test
Type: test program
Description: Simple round-trip encoding and decoding test
Location: libdmtx/test/simple_test
Build: make check
Requires: No dependencies
Disable: Not included in default build
-----------------------------------
Name: unit_test
Type: test program
Description: Unit test program
Location: libdmtx/test/unit_test
Build: make check
Requires: No dependencies
Disable: Not included in default build
-----------------------------------