...
 
Commits (2)
*.la
*.lo
*.o
*~
.deps/
.dirstamp
.libs/
aclocal.m4
autom4te.cache/
config/
config.log
config.status
configure
doc/doxygen.conf
doc/man/
doc/reldate.xml
doc/version.xml
gtk/zbarmarshal.c
gtk/zbarmarshal.h
include/config.h
include/config.h.in
include/stamp-h1
java/net/sourceforge/zbar/*.class
java/zbar.jar
java/zbarjni.h
libtool
Makefile
Makefile.in
pygtk/zbarpygtk.c
pygtk/zbarpygtk.defs
qt/moc_*.cpp
test/check_dbus.sh
test/test_examples.sh
test/test_convert
test/test_cpp
test/test_cpp_img
test/test_dbus
test/test_decode
test/test_jpeg
test/test_proc
test/test_video
zbarcam/moc_*.h
zbarcam/zbarcam
zbarcam/zbarcam-gtk
zbarcam/zbarcam-qt
zbarimg/zbarimg
zbar*.pc
syntax: glob
*~
Makefile
Makefile.in
aclocal.m4
configure
config
config.guess
config/config.h
config.h.in
config.log
config.status
config.sub
depcomp
compile
install-sh
libtool
ltmain.sh
autom4te.cache
missing
python/MANIFEST
build
*.xcodeproj/*.mode1v3
*.xcodeproj/*.pbxuser
xcuserdata
contents.xcworkspacedata
.DS_Store
android/obj
*.class
*.dex
android/libs
android/examples/*/libs
android/*.zip
android/local.properties
android/examples/*/local.properties
20d75a548cf6daee2e590683ee2166d6af24e94f 0.5
590b1d022f92b67f1bcd52b3c2810682285a5f6b 0.7
6cdb3f2ec455b6abb747adfe236c619c6c0ee1ef 0.2
c6178a9dde5527c0ff59e8e7e3e04f9057e0c3a2 0.3
c7ff4e3a6f6d8e9ccdebece0ff276db5cecf34fd 0.6
f68c5b088507f424840f8efa4077aac37c5390cd 0.4
fe6f4843de209522918690dc741fd7fff442ef6d 0.1
f0aa6bf0cab7fda8725ce0da35d3e69473269c71 0.8
38265c7b4ad4dfafe7b5e9eae4bb0d43d68b4143 0.9
2dc2d73c468a032edc68a127e9ddbbfe5f520777 0.9
f3670ba47f2e070f4c43e97f4de3200903720e73 0.10
f3670ba47f2e070f4c43e97f4de3200903720e73 0.10
563557a923d0e23e36c81878d660aefc1c0fe3e7 0.10
b21098d27ff88c4f1a529fe0762f1cb307e04399 iPhoneSDK-0.1
b0bda6247b2fe4ffb52db89a776f91244f25d897 iPhoneSDK-0.1.1
d1655a680c3df68b3466d3b2c714f30af7223ec6 iPhoneSDK-0.1.2
4556c996acaaa6fcd5e8e9879f410f8120746e2b iPhoneSDK-1.0
12de07e51dce0d1cfc3e9699bbf9d5c8774a5371 iPhoneSDK-1.0.1
12de07e51dce0d1cfc3e9699bbf9d5c8774a5371 iPhoneSDK-1.0.1
2541a66ae7d64fbd923168ae677abb156021e88d iPhoneSDK-1.0.1
5e5060b563a1878ea297af5a50261d14cf1cb449 iPhoneSDK-1.1
f9e46865dbcebd04683ca7592ab32aeda615e772 iPhoneSDK-1.1.1
801318a6195060c31259da1f076ecc9a609616cc iPhoneSDK-1.1.2
4bbb4e2bdba8c41a282df7e65a02797250f44daa iPhoneSDK-1.1.3
1ad84c3c03252c366a82552fa952674ec593c73f iPhoneSDK-1.2
9e7bad13ae6a4b65e0f0964512f96284d37f0dc8 iPhoneSDK-1.2.1
146b857ff41ae462cc52f8dddf46d867763433a1 iPhoneSDK-1.2.2
9b946a7ead73ac99e121de2e7f495213cda88e6f AndroidSDK-0.1
5eb3c8786845fe3ad2c74f6a660e70176b88347f iPhoneSDK-1.3.1
language: cpp
compiler: gcc
dist: xenial
sudo: required
notifications:
email:
recipients:
- mchehab@kernel.org
on_success: change
on_failure: always
cache:
directories:
- $HOME/.ccache
- $HOME/pbuilder-bases
matrix:
include:
- env: TARGET_OS=xenial
- env: TARGET_OS=debian-sid
- compiler: clang
env: TARGET_OS=debian-sid
before_install:
- "${TRAVIS_BUILD_DIR}/travis/${TRAVIS_OS_NAME}.${TARGET_OS}.before_install"
install:
- "${TRAVIS_BUILD_DIR}/travis/${TRAVIS_OS_NAME}.${TARGET_OS}.install"
script:
- "${TRAVIS_BUILD_DIR}/travis/${TRAVIS_OS_NAME}.${TARGET_OS}.script"
after_script:
- ccache -s
The ZBar Bar Code Reader is Copyright (C) 2007-2009 Jeff Brown
The ZBar Bar Code Reader is Copyright (C) 2007-2011 Jeff Brown
<spadix@users.sourceforge.net>
The QR Code reader is Copyright (C) 1999-2009 Timothy B. Terriberry
<tterribe@xiph.org>
......
0.22:
* zbarcam-qt: allow changing resolutions in real time
* zbarcam-qt: better support ZBar options
* zbarcam-qt: do several visual improvements
* zbarcam-qt: make it remember the geometry
* zbarcam-qt: allow show/hide control and options bars
* zbarcam-qt: remember lastly used settings and camera controls
* zbarcam-qt: allow changing ZBar decode options via GUI
* Add API to allow get/set resolutions
* img_scanner: add handler for color-inverted codes
* img_scanner: fix get_config parameter validation
* scan_video: improve logic to remove duplicated/invalid devnodes
* symbol.c: fix symbol hash logic (prevents crash with QR options)
* configure.ac: fix an error at libv4l2 package check
* fix some typos
* exit gracefully when decoding split QR codes
0.21:
* zbarcam-qt: allow selecting codes via GUI interface
* When both enabled, ISBN-13 has precedence over ISBN-10
* ZBar is now using Travis CI for continuous integration tests
* Convert INSTALL and README to markdown and update them
* Improve ZBar testing code and make easier to run the tests
* Fix build with Clang
* Add simple dbus IPC API to zbarcam.
* zbarimg: display only the compiled symbologies
* v4l2: make ZBar build and run on Kernels < 3.16
* configure.ac: The pdf417 code is incomplete. Warn about that
* Add Debian packaging and Travis CI configuration
* Add barcode examples for different supported symbologies
* Several improvements at the building system
* Add support for SQ code symbology
* v4l2: add fallback for systems without v4l2_ext_controls which field
* v4l2: use device_caps instead of capabilities
* v4l2: make v4l2_request_buffers() more generic
* release video buffers after probing and request them again when needed
* Ignore ENOTTY errors when calling VIDIOC_S_CROP
* doc/Makefile.am.inc: clean html generated files
* Add --disable-doc configure option to disable building docs
* Fix function prototype to be compatible with recent libjpeg
* Wrap logical not operations into parentheses
* INSTALL: warn that autoconf should be called before configure
* code128: fix error logic
* convert: ensure that it will not use a freed value
* zbar: use g_thread_new() instead of g_tread_create()
* zbargtk: add a missing break
* gtk/zbargtk: add a missing check if zbar->window is not null
0.20.1:
* Be sure to use python2, as /usr/bin/python is being removed
(or made non-functional) on some distributions
* Prefer using pygobject-codegen-2.0 instead of pygtk-codegen-2.0
* Make it work with modern versions of python 2
0.20:
* As upstream became abandoned, created a ZBar fork at linuxtv.org
* Use libv4l2 for V4L2 support, using emulated formats as last resort
* Add support for Qt5
* Add zbarcam-qt and zbarcam-gtk (from the example codes)
* Add support for v4l2 controls
* Add the needed GUI bits for zbarcam-qt to work with controls
* Fix compilation issues with newer automake versions
0.11:
* Codabar reliability enhancements
- fix missing check
- require minimum quality
- bump default uncertainty
* tweak Codabar bar/space ratio validation
* finish Codabar support for python, perl, java and iPhone interfaces
- reduce Codabar uncertainty to minimum
* add core support for Codabar symbology
- TBD: python, perl, java and iPhone interfaces
* fix v4l config and build variations (bug #3348888)
- thanks to jarekczek for reporting this!
- NB v4l1 removed from kernel as of 2.6.38
* fix missing python thread initialization (bug #3349199)
- thanks to jarekczek for reporting this problem!
* fix missing configure check for Python.h (bug #3092663)
- thanks to Zoltan Kovacs for reporting this problem!
* fix C++ wrapper missing Symbol.quality (bug #3076524)
- thanks to Rudy Melli for pointing this out!
* fix C++ wrapper bugs (bug #3396068)
- thanks to anotheruser1 for reporting this!
- add new C++ wrapper test
* fix avoid compositing ISBN10 data
* add support for GraphicsMagick as ImageMagick alternative
* mention xmlto in HACKING (patch #3297039)
- thanks to jarekczek for the patch!
* disable addons by default until synchronization with main symbol is working
* fix image scanner min quality filtering
* fix i25 buffer overrun corner case
* fix EAN addon enables
* fix zbarimg to accept autodetected stdin (lone dash)
* fix Qt 4.6.3 compilation error (patch #3178244)
- thanks to hrhristov for the patch!
* add Python Processor support for request_size interface
* fix Python Processor support for GIL, allowing asynchronous scanning
* fix jpeg decoder skip handling
- thanks to jarekczek for the patch!
* rename dprintf macro to avoid conflicts (patch #3128538)
- thanks to maurochehab for the patch!
* add support for EAN/UPC 2 and 5 digit add-on symbols
- deprecate original, unfinished add-on APIs
- add self-checking to test_decode
* fix support for GS1 AIs
- thanks to jockusch for a patch!
- add decoder/symbol "modifier" flags and config read access
- set flags or emit GS appropriately for Code 128 FNC1
- add iphone, java, perl, python bindings for modifiers and configs
* add support for Code 93 symbology
* add video size request to (Py)GTK widget (req #3034522)
- thanks to Jerome Charaoui for the patch!
* add support for GS1 DataBar Expanded (RSS Expanded) symbology
* add language bindings for DataBar
* add preliminary support for GS1 DataBar (RSS-14) symbology
* enhance decoder reliability (EAN, Code 39, Code 128)
- enhance decoder test
* fix documentation of command exit codes (bug #3017322)
* fix C++ video callback bug
- add C and C++ processor examples
* add per-symbology cache consistency
- reliable symbologies decode immediately by default
- no more need to disable cache with video
- also fix crop bugs w/video scanning
* add support for scanning partial images (cropping)
- update c++, python, perl, java bindings and tests
* fix couple of leaks
* remove doc hints about GFDL (bug #3004411)
- apply LGPL to API docs
* relax Code 39 width ratio checks
* core library portability improvements
- remove some unnecessary C99 syntax
- add configure checks for errno
- enhance C++ Symbol interface
* adjust Python module README (add examples and note DLL in path)
* fix QR Code missing from man pages (bug #2969857)
* cleanup decoder assertions and locking (bug #2966916)
* add Java interface to library via JNI
- add Java tools and JNI build tests to configure
- fix compiler warnings from binary output changes
* fix output of binary data in zbarimg and zbarcam
- thanks to fukuchi for a patch!
- add base64 format for binary xml output
* add coarse symbol orientation information (patch #2913094)
- thanks to Anssi for a patch!
- add decode direction feedback to decoder
- update C++, Python, Perl and ObjC wrappers
- add orientation to test suites
* fix inconsistent fourcc endian handling bugs (bug #2918994)
- thanks to jdccdevel for a patch!
- add fourcc conversion and parse interfaces to zbar.h
* report QR immediately for video (no inter-frame consistency check)
* add python distutils build infrastructure
version 0.10:
* hotfix add MinGW import lib to Windows installer
* attempt fix for Qt4 < 4.4
* release updates
- fix perl Processor init without video
......
......@@ -13,6 +13,12 @@ be fine):
GNU autoconf 2.61
GNU automake 1.10.1
GNU libtool 2.2.6
GNU gettext 0.18.1.1
GNU pkg-config 0.25
xmlto 0.0.20-5 (for docs building)
all above mentioned tools (except xmlto) must be installed in the same
prefix. mixing prefixes (i.g. /usr/bin and /usr/local/bin) may lead to
errors in configuration stages
when you're done hacking and want to make your patch, run:
......
This diff is collapsed.
AM_CPPFLAGS = -I$(srcdir)/include
AM_CFLAGS = -Wall -Wno-parentheses
AM_CXXFLAGS = $(AM_CFLAGS)
ACLOCAL_AMFLAGS = -I config
bin_PROGRAMS =
check_PROGRAMS =
......@@ -9,13 +6,16 @@ lib_LTLIBRARIES =
pyexec_LTLIBRARIES =
CLEANFILES =
DISTCLEANFILES =
MAINTAINERCLEANFILES =
BUILT_SOURCES =
EXTRA_DIST =
SUBDIRS = .
PHONY = $(SUBDIRS)
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = zbar.pc
dist_doc_DATA = COPYING HACKING INSTALL LICENSE NEWS README TODO
dist_doc_DATA = COPYING HACKING INSTALL.md LICENSE NEWS README.md TODO
include $(srcdir)/include/Makefile.am.inc
include $(srcdir)/zbar/Makefile.am.inc
......@@ -39,19 +39,27 @@ if HAVE_QT
include $(srcdir)/qt/Makefile.am.inc
pkgconfig_DATA += zbar-qt.pc
endif
if HAVE_JAVA
SUBDIRS += java
endif
if HAVE_NPAPI
include $(srcdir)/plugin/Makefile.am.inc
endif
include $(srcdir)/test/Makefile.am.inc
if HAVE_DOC
include $(srcdir)/doc/Makefile.am.inc
endif
if HAVE_DBUS
dbusconfdir = @DBUS_CONFDIR@
dbusconf_DATA = $(srcdir)/dbus/org.linuxtv.Zbar.conf
EXTRA_DIST += $(dbusconf_DATA)
endif
EXTRA_DIST += zbar.ico zbar.nsi
EXTRA_DIST += examples/upcrpc.pl examples/upcrpc.py examples/paginate.pl \
examples/barcode.png examples/processor.pl examples/processor.py \
examples/read_one.py examples/read_one.pl \
examples/scan_image.c examples/scan_image.cpp examples/scan_image.pl \
examples/scan_image.py examples/scan_image.vcproj
EXTRA_DIST += examples/*.png examples/upcrpc.py examples/upcrpc.pl \
examples/scan_image.c examples/scan_image.cpp examples/scan_image.vcproj
EXTRA_DIST += perl/MANIFEST perl/README perl/Changes perl/COPYING.LIB \
perl/Makefile.PL perl/typemap perl/ZBar.xs perl/ppport.h \
......@@ -87,4 +95,12 @@ dist-nsis: html-local
cd _nsis && \
makensis -NOCD -V2 -DVERSION=$(VERSION) $(abs_srcdir)/zbar.nsi
@ls -l _nsis/zbar-$(VERSION)-setup.exe
PHONY += dist-nsis
endif
archive:
git archive --format=tar --prefix=zbar-$(VERSION)/ -o zbar-$(VERSION).tar $(VERSION)
bzip2 zbar-$(VERSION).tar
.PHONY : $(PHONY) archive
This source diff could not be displayed because it is too large. You can view the blob instead.
ZBar Barcode Reader
version 0.20.1 (2018-08-08):
Minor changes at ZBar, in order to adapt to modern distributions
with are removing /usr/bin/python in favor of just using python2.
Also, updated some python2 scripts to work with modern distros,
where the Image module is now inside PIL.
version 0.20 (2017-04-11):
As upstream didn't have any version since 2009, created a ZBar fork at
linuxtv.org. This release improves a lot V4L2 support, by using libv4l2
to handle formats that are alien to ZBar, making it compatible with a lot
more webcam models. Qt support was also updated, making it compatible
with Qt5. ZBar now have two other GUI applications (zbarcam-qt and
zbarcam-gtk). With zbarcam-qt, it is now possible to adjust the camera
controls, making easier to read barcodes using a camera.
version 0.10 (2009-10-23):
ZBar goes 2D! This release introduces support for QR Code, developed
by our new project member, Timothy Terriberry. Timothy is an image
......
......@@ -4,92 +4,134 @@ ZBAR BAR CODE READER
ZBar Bar Code Reader is an open source software suite for reading bar
codes from various sources, such as video streams, image files and raw
intensity sensors. It supports EAN-13/UPC-A, UPC-E, EAN-8, Code 128,
Code 39, Interleaved 2 of 5 and QR Code. Included with the library
are basic applications for decoding captured bar code images and using
a video device (eg, webcam) as a bar code scanner. For application
developers, language bindings are included for C, C++, Python and Perl
as well as GUI widgets for Qt, GTK and PyGTK.
Code 93, Code 39, Codabar, Interleaved 2 of 5, QR Code and SQ Code.
Check the ZBar home page for the latest release, mailing lists, etc.
http://zbar.sourceforge.net/
Included with the library are basic applications for decoding captured bar
code images and using a video device (eg, webcam) as a bar code scanner.
For application developers, language bindings are included for C, C++,
Python 2 and Perl as well as GUI widgets for Qt, GTK and PyGTK 2.0.
License information can be found in 'COPYING'.
Zbar also supports sending the scanned codes via dbus, allowing its
integration with other applications.
Check the ZBar home page for the latest release, mailing lists, etc.:
- <https://github.com/mchehab/zbar>
License information can be found in `COPYING`.
BUILDING
========
See 'INSTALL' for generic configuration and build instructions.
See `INSTALL.md` for generic configuration and build instructions.
The scanner/decoder library itself only requires a few standard
library functions which should be avilable almost anywhere.
library functions which should be available almost anywhere.
The zbarcam program uses the video4linux API (v4l1 or v4l2) to access
the video device. This interface is part of the linux kernel, a 2.6
kernel is recommended for full support. More information is available
at
http://www.linuxtv.org/wiki/
pkg-config is used to locate installed libraries. You should have
installed pkg-config if you need any of the remaining components.
pkg-config may be obtained from
http://pkg-config.freedesktop.org/
The zbarimg program uses ImageMagick to read image files in many
different formats. You will need at least ImageMagick version 6.2.6
if you want to scan image files. ImageMagick may be obtained from
http://www.imagemagick.org/
The Qt widget requires Qt4. You will need Qt4 if you would like to
the video device. This interface is part of the linux kernel, a 3.16
kernel or upper is recommended for full support. More information is
available at:
- <http://www.linuxtv.org/wiki/>
`pkg-config` is used to locate installed libraries. You should have
installed `pkg-config` if you need any of the remaining components.
pkg-config may be obtained from:
- <http://pkg-config.freedesktop.org/>
The `zbarimg` program uses `ImageMagick` to read image files in many
different formats. You will need at least `ImageMagick` version 6.2.6
if you want to scan image files. `ImageMagick` may be obtained from:
- <http://www.imagemagick.org/>
The Qt widget requires Qt4 or Qt5. You will need Qt if you would like to
use or develop a Qt GUI application with an integrated bar code
scanning widget. Qt4 may be obtained from
http://qt.nokia.com/products
scanning widget. Qt4 may be obtained from:
- <https://www.qt.io/>
The GTK+ widget requires GTK+-2.x. You will need GTK+ if you would
like to use or develop a GTK+ GUI application with an integrated bar
code scanning widget. GTK+ may be obtained from
http://www.gtk.org/
code scanning widget. GTK+ may be obtained from:
- <http://www.gtk.org/>
The PyGTK wrapper for the GTK+ widget requires Python and PyGTK. You
will need both if you would like to use or develop a PyGTK GUI
The PyGTK 2.0 wrapper for the GTK+ widget requires Python 2, PyGTK.
You will need both if you would like to use or develop a PyGTK GUI
application with an integrated bar code scanning widget. PyGTK may be
obtained from
http://www.pygtk.org/
obtained from:
The Python bindings require Python (version?). You will need Python
- <http://www.pygtk.org/>
The Python bindings require Python 2. You will need Python and PIL
if you would like to scan images or video directly using Python.
Python is available from
http://python.org/
Python is available from:
- <http://python.org/>
The Perl bindings require Perl (version?). You will need Perl if you
would like to scan images or video directly using Perl. Perl is
available from
http://www.perl.org/
available from:
- <http://www.perl.org/>
If required libraries are not available you may disable building for
the corresponding component using configure (see configure --help).
The Perl bindings must be built separately after installing the
library. see
perl/README
library. see:
- `perl/README`
RUNNING
=======
'make install' will install the library and application programs. Run
'zbarcam' to start the video scanner. use 'zbarimg barcode.jpg' to
decode a saved image file. Check the manual to find specific options
for each program.
`make install` will install the library and application programs. Run
`zbarcam-qt` or `zbarcam` to start the video scanner. Use `zbarimg <file>`
to decode a saved image file.
Check the manual to find specific options for each program.
DBUS TESTING
============
In order to test if dbus is working, you could use:
$ dbus-monitor --system interface=org.linuxtv.Zbar1.Code
or build the test programs with:
$ make test_progs
And run:
$ ./test/test_dbus
With that, running this command on a separate shell:
$ ./zbarimg/zbarimg examples/code-128.png
CODE-128:https://github.com/mchehab/zbar
scanned 1 barcode symbols from 1 images in 0.01 seconds
Will produce this output at test_dbus shell window:
Waiting for Zbar events
Type = CODE-128
Value = https://github.com/mchehab/zbar
REPORTING BUGS
==============
Bugs can be reported on the sourceforge project page
http://www.sourceforge.net/projects/zbar/
Bugs can be reported on the project page:
- <https://github.com/mchehab/zbar>
Please include the ZBar version number and a detailed description of
the problem. You'll probably have better luck if you're also familiar
with the concepts from:
http://www.catb.org/~esr/faqs/smart-questions.html
- <http://www.catb.org/~esr/faqs/smart-questions.html>
......@@ -3,8 +3,8 @@ ZBAR BAR CODE READER
ZBar Bar Code Reader is an open source software suite for reading bar codes
from various sources, such as video streams, image files and raw intensity
sensors. It supports EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 39,
Interleaved 2 of 5 and QR Code. Included with the library are basic
sensors. It supports EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 93, Code 39,
Codabar, Interleaved 2 of 5 and QR Code. Included with the library are basic
applications for decoding captured bar code images and using a video device
(eg, webcam) as a bar code scanner. For application developers, language
bindings are included for C, C++, Python and Perl as well as GUI widgets for
......
......@@ -25,7 +25,6 @@ symbologies:
* Code 39, i25 optional features (check digit and ASCII escapes)
* handle Code 128 function characters (FNC1-4)
* Code 128 trailing quiet zone checks
* finish addon decoding
decoder:
* start/stop/abort and location detail APIs (PDF417, OMR)
......
This diff is collapsed.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.sourceforge.zbar.android"
android:versionCode="1"
android:versionName="1.0">
<application android:label="@string/app_name" >
<activity android:name="ACTIVITY_ENTRY_NAME"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
version 0.1:
* Add initial support for Android platform
ZBar Android SDK
================
ZBar Bar Code Reader is an open source software suite for reading bar
codes from various sources, such as video streams, image files and raw
intensity sensors. It supports EAN-13/UPC-A, UPC-E, EAN-8, Code 128,
Code 93, Code 39, Codabar, Interleaved 2 of 5, QR Code and
DataBar. These are the JNI wrappers for developing the library on
Android platform.
Check the ZBar home page for the latest release, mailing lists, etc.
http://zbar.sourceforge.net/
Copyright and License
---------------------
Licensed under the GNU Lesser General Public License, version 2.1.
http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt
Copyright 2008-2012 © Jeff Brown <spadix@users.sourceforge.net> et al
The Android distribution also includes pre-compiled binaries of
supporting libaries, for which copyright, license and source code
locations are as follows:
* The GNU libiconv character set conversion library
Copyright (C) 1999-2011 Free Software Foundation, Inc.
This distribution includes GNU libiconv version 1.14, licensed under
the LGPL version 2. The source code is available from
http://www.gnu.org/software/libiconv
See included files COPYING and LICENSE for details.
Installation
------------
After downloading the ZBar-Android-Lib-<version>.zip file, you need to
unzip the file and add it to your Android project. Unzip the file
using your favorite method (ie: command-line, finder, windows
explorer...)
Follow one of the two options.
Option 1 - via command line
cd <android project>
cp -r ZBar-Android-SDK-<version>/libs .
Option 2 - via Eclipse
Right click on Android Project
Select "Import" -> "File System"
Select "Browse" (next to "From directory File" and select the
ZBar-Android-SDK-<verion>/libs directory and click "Open".
Click the check box next to "libs" and the "Options" "Create top-level folder"
check box (below).
Then click "Finish".
You should then see a "libs" folder under your project.
Building
--------
Via Eclipse
You have to add the zbar.jar file to your build path
1) select zbar.jar under libs
2) right-click, select "Build Path" -> "Add to Build Path"
Via command-line
You are all set; ant will automatcially find jar files under the "libs"
subdirectory.
Documentation
-------------
TDB
Examples
--------
You should be able to open and build the examples directly from the
unzipped directory. You will need to run the android tools to setup
the local.properties file which sets sdk.dir.
1) cd <unzip dir>/examples/CameraTest
2) android update project --path .
3) ant debug install
If you have problems with this, please create a new Android project
and copy the necessary files from the examples.
examples/CameraTest is a simple demonstration of how to integrate the
ZBar image scanner with the camera.
Manually building ZBar JNI library
----------------------------------
First download and unzip the iconv library source from
http://www.gnu.org/software/libiconv/
Then kick off the build from the ZBar android directory. You will
need to run the android tools to setup the local.properties file which
setups sdk.dir.
1) cd <zbar project>/android
2) android update project --path .
3) ant -Dndk.dir=<NDK path> -Diconv.src=<iconv library src> zbar-all
This will rebuild all source files, create zbar.jar and
ZBarAndroidSDK.zip file (which bundles the jar and shared
libraries). From here, you can follow the steps for "Integrating ZBar
JNI library in Android project".
To clean run:
ant -Dndk.dir=<NDK path> zbar-clean
See build-ndk.xml for additional target options.
# This file is used to override default values used by the Ant build system.
#
# This file must be checked in Version Control Systems, as it is
# integral to the build system of your project.
# This file is only used by the Ant script.
# You can use this to override default values such as
# 'source.dir' for the location of your java source folder and
# 'out.dir' for the location of your output folder.
# You can also use it define how the release builds are signed by declaring
# the following properties:
# 'key.store' for the location of your keystore and
# 'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target.
<!--
Ant build file to compile the ZBar JNI files using Android NDK tool
targets:
zbar-clean - removes build generated files, build dir, jar and zip files
zbar-ndk-build - builds the zbarjni and iconv shared libraries
zbar-compile - builds the zbar java files
zbar-jar - builds and jars the zbar java files
zbar-zip - Creates ZBarAndroidSDK-x.y.zip of jar, .so, etc
zbar-all - performs all the above :)
-->
<project name="zbar">
<property name="project.name" value="zbar" />
<property name="project.sdk.name" value="ZBarAndroidSDK" />
<target name="zbar-clean">
<delete dir="../java/build"/>
<delete file="libs/${project.name}.jar"/>
<delete file="${ant.project.name}.zip"/>
<exec executable="${ndk.dir}/ndk-build" failonerror="true">
<arg value="clean"/>
</exec>
</target>
<target name="zbar-ndk-build">
<exec executable="${ndk.dir}/ndk-build" failonerror="true">
<arg value="ICONV_SRC=${iconv.src}" />
</exec>
</target>
<target name="zbar-compile" depends="zbar-ndk-build">
<mkdir dir="../java/build" />
<javac srcdir="../java/net" destdir="../java/build" />
</target>
<target name="zbar-jar" depends="zbar-compile">
<jar destfile="libs/${project.name}.jar" basedir="../java/build">
</jar>
</target>
<target name="zbar-zip">
<if><condition><not><isset property="version"/></not></condition><then>
<property name="version" value="0.2" />
</then></if>
<zip destfile="${project.sdk.name}-${version}.zip" >
<zipfileset dir="../" prefix="${project.sdk.name}-${version}" includes="COPYING, LICENSE"/>
<zipfileset dir="." prefix="${project.sdk.name}-${version}" includes="README"/>
<zipfileset dir="libs" prefix="${project.sdk.name}-${version}/libs"/>
<zipfileset dir="examples" prefix="${project.sdk.name}-${version}/examples"/>
<zipfileset dir="libs" prefix="${project.sdk.name}-${version}/examples/CameraTest/libs"/>
</zip>
</target>
<target name="zbar-all" depends="zbar-jar">
<if><condition><not><isset property="version"/></not></condition><then>
<property name="version" value="0.2" />
</then></if>
<zip destfile="${project.sdk.name}-${version}.zip" >
<zipfileset dir="../" prefix="${project.sdk.name}-${version}" includes="COPYING, LICENSE"/>
<zipfileset dir="." prefix="${project.sdk.name}-${version}" includes="README"/>
<zipfileset dir="libs" prefix="${project.sdk.name}-${version}/libs"/>
<zipfileset dir="examples" prefix="${project.sdk.name}-${version}/examples"/>
<zipfileset dir="libs" prefix="${project.sdk.name}-${version}/examples/CameraTest/libs"/>
</zip>
</target>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project name="ZBarAndroidSDK" default="help">
<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. -->
<property file="local.properties" />
<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:
source.dir
The name of the source directory. Default is 'src'.
out.dir
The name of the output directory. Default is 'bin'.
For other overridable properties, look at the beginning of the rules
files in the SDK, at tools/ant/build.xml
Properties related to the SDK location or the project target should
be updated using the 'android' tool with the 'update' action.
This file is an integral part of the build system for your
application and should be checked into Version Control Systems.
-->
<property file="ant.properties" />
<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
unless="sdk.dir"
/>
<!-- extension targets. Uncomment the ones where you want to do custom work
in between standard targets -->
<!--
<target name="-pre-build">
</target>
<target name="-pre-compile">
</target>
/* This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir} */
<target name="-post-compile">
<copy file="${out.absolute.dir}/classes.jar" tofile="${jar.libs.dir}/zbar_android.jar" />
</target>
-->
<!-- Import the actual build file.
To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.
***********************
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
-->
<!-- version-tag: 1 -->
<import file="build-ndk.xml" />
<import file="${sdk.dir}/tools/ant/build.xml" />
</project>
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.sourceforge.zbar.android.CameraTest"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<application android:label="@string/app_name" >
<activity android:name="CameraTestActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
# This file is used to override default values used by the Ant build system.
#
# This file must be checked in Version Control Systems, as it is
# integral to the build system of your project.
# This file is only used by the Ant script.
# You can use this to override default values such as
# 'source.dir' for the location of your java source folder and
# 'out.dir' for the location of your output folder.
# You can also use it define how the release builds are signed by declaring
# the following properties:
# 'key.store' for the location of your keystore and
# 'key.alias' for the name of the key to use.
# The password will be asked during the build when you use the 'release' target.
<?xml version="1.0" encoding="UTF-8"?>
<project name="CameraTest" default="help">
<!-- The local.properties file is created and updated by the 'android' tool.
It contains the path to the SDK. It should *NOT* be checked into
Version Control Systems. -->
<property file="local.properties" />
<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:
source.dir
The name of the source directory. Default is 'src'.
out.dir
The name of the output directory. Default is 'bin'.
For other overridable properties, look at the beginning of the rules
files in the SDK, at tools/ant/build.xml
Properties related to the SDK location or the project target should
be updated using the 'android' tool with the 'update' action.
This file is an integral part of the build system for your
application and should be checked into Version Control Systems.
-->
<property file="ant.properties" />
<!-- The project.properties file is created and updated by the 'android'
tool, as well as ADT.
This contains project specific properties such as project target, and library
dependencies. Lower level build properties are stored in ant.properties
(or in .classpath for Eclipse projects).
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var"
unless="sdk.dir"
/>
<!-- extension targets. Uncomment the ones where you want to do custom work
in between standard targets -->
<!--
<target name="-pre-build">
</target>
<target name="-pre-compile">
</target>
/* This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir} */
<target name="-post-compile">
</target>
-->
<!-- Import the actual build file.
To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.
***********************
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
-->
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />
</project>
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "ant.properties", and override values to adapt the script to your
# project structure.
# Project target.
target=android-15
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<FrameLayout
android:id="@+id/cameraPreview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
/>
<TextView
android:id="@+id/scanText"
android:text="Scanning..."
android:layout_height="wrap_content"
android:layout_width="match_parent">
</TextView>
<Button
android:id="@+id/ScanButton"
android:text="Scan"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
/>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">ZBar CameraTest</string>
</resources>
/*
* Barebones implementation of displaying camera preview.
*
* Created by lisah0 on 2012-02-24
*/
package net.sourceforge.zbar.android.CameraTest;
import java.io.IOException;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.Surface;
import android.view.SurfaceView;
import android.view.SurfaceHolder;
import android.content.Context;
import android.hardware.Camera;
import android.hardware.Camera.PreviewCallback;
import android.hardware.Camera.AutoFocusCallback;
import android.hardware.Camera.Parameters;
/** A basic Camera preview class */
public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback {
private SurfaceHolder mHolder;
private Camera mCamera;
private PreviewCallback previewCallback;
private AutoFocusCallback autoFocusCallback;
public CameraPreview(Context context, Camera camera,
PreviewCallback previewCb,
AutoFocusCallback autoFocusCb) {
super(context);
mCamera = camera;
previewCallback = previewCb;
autoFocusCallback = autoFocusCb;
/*
* Set camera to continuous focus if supported, otherwise use
* software auto-focus. Only works for API level >=9.
*/
/*
Camera.Parameters parameters = camera.getParameters();
for (String f : parameters.getSupportedFocusModes()) {
if (f == Parameters.FOCUS_MODE_CONTINUOUS_PICTURE) {
mCamera.setFocusMode(Parameters.FOCUS_MODE_CONTINUOUS_PICTURE);
autoFocusCallback = null;
break;
}
}
*/
// Install a SurfaceHolder.Callback so we get notified when the
// underlying surface is created and destroyed.
mHolder = getHolder();
mHolder.addCallback(this);
// deprecated setting, but required on Android versions prior to 3.0
mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
}
public void surfaceCreated(SurfaceHolder holder) {
// The Surface has been created, now tell the camera where to draw the preview.
try {
mCamera.setPreviewDisplay(holder);
} catch (IOException e) {
Log.d("DBG", "Error setting camera preview: " + e.getMessage());
}
}
public void surfaceDestroyed(SurfaceHolder holder) {
// Camera preview released in activity
}
public void surfaceChanged(SurfaceHolder holder, int format, int width, int height) {
/*
* If your preview can change or rotate, take care of those events here.
* Make sure to stop the preview before resizing or reformatting it.
*/
if (mHolder.getSurface() == null){
// preview surface does not exist
return;
}
// stop preview before making changes
try {
mCamera.stopPreview();
} catch (Exception e){
// ignore: tried to stop a non-existent preview
}
try {
// Hard code camera surface rotation 90 degs to match Activity view in portrait
mCamera.setDisplayOrientation(90);
mCamera.setPreviewDisplay(mHolder);
mCamera.setPreviewCallback(previewCallback);
mCamera.startPreview();
mCamera.autoFocus(autoFocusCallback);
} catch (Exception e){
Log.d("DBG", "Error starting camera preview: " + e.getMessage());
}
}
}
/*
* Basic no frills app which integrates the ZBar barcode scanner with
* the camera.
*
* Created by lisah0 on 2012-02-24
*/
package net.sourceforge.zbar.android.CameraTest;
import net.sourceforge.zbar.android.CameraTest.CameraPreview;
import android.app.Activity;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.widget.FrameLayout;
import android.widget.Button;
import android.hardware.Camera;
import android.hardware.Camera.PreviewCallback;
import android.hardware.Camera.AutoFocusCallback;
import android.hardware.Camera.Parameters;
import android.hardware.Camera.Size;
import android.widget.TextView;
import android.graphics.ImageFormat;
/* Import ZBar Class files */
import net.sourceforge.zbar.ImageScanner;
import net.sourceforge.zbar.Image;
import net.sourceforge.zbar.Symbol;
import net.sourceforge.zbar.SymbolSet;
import net.sourceforge.zbar.Config;
public class CameraTestActivity extends Activity
{
private Camera mCamera;
private CameraPreview mPreview;
private Handler autoFocusHandler;
TextView scanText;
Button scanButton;
ImageScanner scanner;
private <