dmtx / dmtx-utils Goto Github PK
View Code? Open in Web Editor NEWlibdmtx Utilities
License: GNU Lesser General Public License v2.1
libdmtx Utilities
License: GNU Lesser General Public License v2.1
================================================================= libdmtx - Open Source Data Matrix Software ================================================================= dmtx-utils README file (all platforms) This summary of the dmtx-utils 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, etc...). 1. Introduction ----------------------------------------------------------------- libdmtx is a software library that enables programs to read and write Data Matrix barcodes of the modern ECC200 variety. This package, dmtx-utils, provides command line utilities that allow scripts and command line users to use libdmtx functionality. 2. Installation ----------------------------------------------------------------- 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 Git 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. Also, if you built and installed the libdmtx library from source it's like that configure gave you an error similar to this: configure: error: dmtxread/dmtxwrite requires libdmtx >= 0.7.0 You can fix this by telling configure where to find libdmtx.pc: $ ./configure PKG_CONFIG_PATH=/usr/local/lib/pkgconfig Note: This path may be different on your system. Details on "make" step ---------------------------------------- Errors encountered during the "make" step are often a result of missing software dependencies. 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 3. 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. 4. 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] Professional support: www.dragonflylogic.com/products
make all-recursive
make[1]: Entering directory /data1/projects/zhennanchen/sourceCode/dmtx-utils-0.7.6' Making all in . make[2]: Entering directory
/data1/projects/zhennanchen/sourceCode/dmtx-utils-0.7.6'
make[2]: Leaving directory /data1/projects/zhennanchen/sourceCode/dmtx-utils-0.7.6' Making all in dmtxread make[2]: Entering directory
/data1/projects/zhennanchen/sourceCode/dmtx-utils-0.7.6/dmtxread'
/bin/sh ../libtool --tag=CC --mode=link gcc -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/data1/projects/zhennanchen/appSoftware/ImageMagick-7.0.11-0/include/ImageMagick-7 -D_MAGICK_CONFIG_H -g -O2 -L/data1/projects/zhennanchen/appSoftware/libdmtx-0.7.5/lib -ldmtx -L/data1/projects/zhennanchen/appSoftware/ImageMagick-7.0.11-0/lib -lMagickWand-7.Q16HDRI -lMagickCore-7.Q16HDRI -o dmtxread dmtxread-dmtxread.o ../common/dmtxread-dmtxutil.o -lm
/bin/sh ../libtool --tag=CC --mode=link gcc -fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/data1/projects/zhennanchen/appSoftware/ImageMagick-7.0.11-0/include/ImageMagick-7 -D_MAGICK_CONFIG_H -g -O2 -static -L/data1/projects/zhennanchen/appSoftware/libdmtx-0.7.5/lib -ldmtx -L/data1/projects/zhennanchen/appSoftware/ImageMagick-7.0.11-0/lib -lMagickWand-7.Q16HDRI -lMagickCore-7.Q16HDRI -o dmtxread.debug dmtxread_debug-dmtxread.o ../common/dmtxread_debug-dmtxutil.o -lm
libtool: error: cannot find the library '/data/home/zhennanchen/appSoftware/gcc-8.2.0/lib/../lib64/libgomp.la' or unhandled argument '/data/home/zhennanchen/appSoftware/gcc-8.2.0/lib/../lib64/libgomp.la'
make[2]: *** [dmtxread.debug] Error 1
make[2]: *** Waiting for unfinished jobs....
libtool: error: cannot find the library '/data/home/zhennanchen/appSoftware/gcc-8.2.0/lib/../lib64/libgomp.la' or unhandled argument '/data/home/zhennanchen/appSoftware/gcc-8.2.0/lib/../lib64/libgomp.la'
make[2]: *** [dmtxread] Error 1
make[2]: Leaving directory /data1/projects/zhennanchen/sourceCode/dmtx-utils-0.7.6/dmtxread' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory
/data1/projects/zhennanchen/sourceCode/dmtx-utils-0.7.6'
make: *** [all] Error 2
I've played around with another datamatrix generator like https://github.com/boombuler/barcode (golang).
That generator generates datamatrixes where the dimensions are not determined
by module size or margin.
Unfortunately dmtxread
cannot read them: it exits with status 1, and no error.
Other readers like https://online-barcode-reader.inliteresearch.com/ can read it.
dmtxread does work if I produce a datamatrix with the "expected" dimensions, i.e. the dimensions
dmtwrite would produce if it were to write the same input text.
My golang code that produces png (stdout!) that dmtxread can read:
package main
import (
"image/png"
"os"
"github.com/boombuler/barcode"
"github.com/boombuler/barcode/datamatrix"
"fmt"
)
func main() {
// Create the barcode
code, c_err := datamatrix.Encode("hello")
if c_err != nil {
fmt.Println(os.Stderr,"error: %s",c_err)
os.Exit(1)
}
//without this line, dmtxread fails to read it
code,_ = barcode.Scale(code,80,80)
// encode the barcode as png
png.Encode(os.Stdout, code)
}
As stated: withouth scaling statement, dmtxread fails to read it.
Any idea?
See here my resulting png:
> echo 'Hello World' | dmtxwrite -f pdf | dmtxread
dmtxread: Unable to open file "-" for reading
I tried brew reinstall ImageMagick
and brew reinstall dmtx-utils
.
> brew info dmtx-utils
dmtx-utils: stable 0.7.5 (bottled)
Read and write data matrix barcodes
https://github.com/dmtx/dmtx-utils
/usr/local/Cellar/dmtx-utils/0.7.5 (14 files, 119.3KB) *
Poured from bottle on 2017-05-03 at 15:50:19
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/dmtx-utils.rb
==> Dependencies
Build: autoconf ✔, automake ✔, pkg-config ✔
Required: imagemagick ✔, libdmtx ✔, libtool ✔
> brew info imagemagick
imagemagick: stable 7.0.5-5 (bottled), HEAD
Tools and libraries to manipulate images in many formats
https://www.imagemagick.org/
/usr/local/Cellar/imagemagick/7.0.5-4 (1,522 files, 22.6MB)
Poured from bottle on 2017-03-26 at 20:24:25
/usr/local/Cellar/imagemagick/7.0.5-5 (1,522 files, 22.4MB) *
Poured from bottle on 2017-05-03 at 15:49:55
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/imagemagick.rb
==> Dependencies
Build: pkg-config ✔
Required: libtool ✔, xz ✔
Recommended: jpeg ✔, libpng ✔, libtiff ✔, freetype ✔
Optional: fontconfig ✔, little-cms ✘, little-cms2 ✔, libwmf ✘, librsvg ✘, liblqr ✘, openexr ✘, ghostscript ✘, webp ✔, openjpeg ✘, fftw ✘, pango ✘
==> Requirements
Optional: x11 ✘, perl >= 5.5 ✔
==> Options
--with-fftw
Compile with FFTW support
--with-fontconfig
Build with fontconfig support
--with-ghostscript
Build with ghostscript support
--with-hdri
Compile with HDRI support
--with-liblqr
Build with liblqr support
--with-librsvg
Build with librsvg support
--with-libwmf
Build with libwmf support
--with-little-cms
Build with little-cms support
--with-little-cms2
Build with little-cms2 support
--with-opencl
Compile with OpenCL support
--with-openexr
Build with openexr support
--with-openjpeg
Build with openjpeg support
--with-openmp
Compile with OpenMP support
--with-pango
Build with pango support
--with-perl
Compile with PerlMagick
--with-quantum-depth-16
Compile with a quantum depth of 16 bit
--with-quantum-depth-32
Compile with a quantum depth of 32 bit
--with-quantum-depth-8
Compile with a quantum depth of 8 bit
--with-webp
Build with webp support
--with-x11
Build with x11 support
--with-zero-configuration
Disables depending on XML configuration files
--without-freetype
Build without freetype support
--without-jpeg
Build without jpeg support
--without-libpng
Build without libpng support
--without-libtiff
Build without libtiff support
--without-magick-plus-plus
disable build/install of Magick++
--without-modules
Disable support for dynamically loadable modules
--without-threads
Disable threads support
--HEAD
Install HEAD version
I get a "dmtxwrite: Unable to encode message (possibly too large for requested size)" message when trying to barcode a 3-character message (like "W6x") with the -s 10x10 option. A 12x12 barcode is correctly built with the -s 12x12 option.
Online barcode generators build a 10x10 with 3 characters without a problem, and these get read by dmtxread as shown:
Matrix Size: 10 x 10
Data Codewords: 3 (capacity 3)
Error Codewords: 5
Data Regions: 1 x 1
Interleaved Blocks: 1
Rotation Angle: 0
Hi all,
I need to encode an XML file to datamatrix on linux.
With 0.7.4 encoding with
dmtxwrite -s 26x26 -e e barcode.xml -o barcode.jpeg
is no problem.
With 0.7.5
dmtxwrite -s 26x26 -e e barcode.xml -o barcode.jpeg
gives:
dmtxwrite: Unable to encode message (possibly too large for requested size)
What can I do? Thanx for your help in advance.
Claudia
I cloned this repo and followed the steps in your instructions.
As predicted, ./configure resulted in "No such file or directory", so I ran ./autogen.sh. Here's what I got:
jw@logopolis:/projects/open/dmtx-utils$ ./autogen.sh
./autogen.sh: 4: ./autogen.sh: [[: not found
autogen.sh: running autoreconf
aclocal: couldn't open directory `m4': No such file or directory
autoreconf: aclocal failed with exit status: 1
after looking around I found that some people got past the m4 issue by just creating an m4 directory. This seemed to work for me but seems suboptimal.
dmtxwrite -l
shows this encouraging list of formats, but there are no pointers or explanations of what they mean.
Where are they documented? If they are listed somewhere, maybe it should be made more obvious where to find them?
3FR DDS GV MAGICK PCL PWP TTC
3G2 DFONT H MAP PCT RADIAL-GRADIENT TTF
3GP DJVU HALD MASK PCX RAF TXT
AAI DNG HDR MAT PDB RAS UBRL
AI DOT HISTOGRAM MATTE PDF RAW UBRL6
ART DPX HRZ MEF PDFA RGB UIL
ARW DXT1 HTM MIFF PEF RGBA UYVY
AVI DXT5 HTML MKV PES RGBO VDA
AVS EPDF HTTP MNG PFA RGF VICAR
BGR EPI HTTPS MONO PFB RLA VID
BGRA EPS ICB MOV PFM RLE VIFF
BGRO EPS2 ICO MP4 PGM RMF VIPS
BIE EPS3 ICON MPC PGX RW2 VST
BMP EPSF IIQ MPEG PICON SCR WBMP
BMP2 EPSI INFO MPG PICT SCT WEBP
BMP3 EPT INLINE MRW PIX SFW WMF
BRF EPT2 IPL MSL PJPEG SGI WMV
CAL EPT3 ISOBRL MSVG PLASMA SHTML WMZ
CALS ERF ISOBRL6 MTV PNG SIX WPG
CANVAS EXR JBG MVG PNG00 SIXEL X
CAPTION FAX JBIG NEF PNG24 SPARSE-COLOR X3F
CIN FILE JNG NRW PNG32 SR2 XBM
CIP FITS JNX NULL PNG48 SRF XC
CLIP FRACTAL JPE ORF PNG64 STEGANO XCF
CMYK FTP JPEG OTB PNG8 SUN XPM
CMYKA FTS JPG OTF PNM SVG XPS
CR2 G3 JPS PAL PPM SVGZ XV
CRW G4 JSON PALM PREVIEW TEXT XWD
CUR GIF K25 PAM PS TGA YCbCr
CUT GIF87 KDC PANGO PS2 THUMBNAIL YCbCrA
DATA GRADIENT LABEL PATTERN PS3 TIFF YUV
DCM GRAY M2V PBM PSB TIFF64
DCR GRAYA M4V PCD PSD TILE
DCX GROUP4 MAC PCDS PTIF TIM
Credit to https://macappstore.org/dmtx-utils/
Install the App
Press Command+Space and type Terminal and press enter/return key.
Copy and paste the following command in Terminal app:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
and press enter/return key. Wait for the command to finish. If you are prompted to enter a password, please type your Mac user's login password and press ENTER. Mind you, as you type your password, it won't be visible on your Terminal (for security reasons), but rest assured it will work.
Now, copy/paste and run this command to make brew command available inside the Terminal: echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
Copy and paste the following command:
brew install dmtx-utils
Done! You can now use dmtx-utils.
The -c argument just output the parcial decode to the output, not as a callback return value:
-c, --codewords print codewords extracted from barcode pattern\n\
Could be added to the backlog a new function that returns the digits that were successfully parsed from the datamatrix ?
When trying to build dmtx-utils 0.7.6 on OS X, I get an error for an undeclared identifier:
clang -DHAVE_CONFIG_H -I. -I.. -Wshadow -Wall -pedantic -I/usr/local/Cellar/libdmtx/0.7.4/include -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/local/Cellar/imagemagick/7.0.7-35/include/ImageMagick-7 -D_MAGICK_CONFIG_H -g -O2 -c -o ../common/dmtxread_debug-dmtxutil.o `test -f '../common/dmtxutil.c' || echo './'`../common/dmtxutil.c
dmtxread.c:525:36: error: dmtxread.c:use of undeclared identifier 'DmtxPropFnc1'
525:36 err = dmtxDecodeSetProp(dec, DmtxPropFnc1, opt->gs1);
: error: ^
use of undeclared identifier 'DmtxPropFnc1'
err = dmtxDecodeSetProp(dec, DmtxPropFnc1, opt->gs1);
^
1 error generated.
1 error generated.
This was introduced in c0a1d52, which was part of #4.
The full build logs are here: https://gist.github.com/mistydemeo/1822dc29b516cf817b90cd35990d614a
Hi,
I'm trying to install dmtx-utils via brew install dmtx-utils
and via git
. It throws an error :
checking for MAGICK... no
configure: error: dmtxread/dmtxwrite requires Wand >= 6.2.4
Error: dmtx-utils was moved to homebrew-boneyard because it has unfixable issues.
After considering many options, I've come to the conclusion that it may well has to do with the specific version of ImageMagick that is installed. It appears that Wand.pc is not even present in ImageMagick 7.0.4-8 (which is currently the current version).
Do you have any suggestions as to how to solve this issue?
Best,
Sander
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.