From 23c808b6cc5346609c80f79e680100e430d6c6ad Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 22 Feb 2013 08:26:55 -0300 Subject: [PATCH] Update to the very latest version of zbar zbar was using a 2010 snapshot of its hg tree. Take a new snapshot to get zbar's improvements. --- sources | 2 +- zbar.spec | 19 +- ...7889f8f73.patch => zbar_update_to_hg.patch | 31476 ++++++++++------ zbar_use_libv4l.patch | 684 +- 4 files changed, 19257 insertions(+), 12924 deletions(-) rename zbar_update_to_617889f8f73.patch => zbar_update_to_hg.patch (63%) diff --git a/sources b/sources index 32db79b..e58d80a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -0fd61eb590ac1bab62a77913c8b086a5 zbar-0.10.tar.bz2 +d8b9dddcf28d6603d8b066816941a9d2 zbar-0.10.tar.bz2 diff --git a/zbar.spec b/zbar.spec index 04e851a..3447be5 100644 --- a/zbar.spec +++ b/zbar.spec @@ -3,17 +3,16 @@ Name: zbar Version: 0.10 -Release: 14%{?dist} +Release: 15%{?dist} Summary: Bar code reader Group: User Interface/X Hardware Support License: LGPLv2+ URL: http://zbar.sourceforge.net/ Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.bz2 -Patch0: zbar_update_to_617889f8f73.patch -Patch1: zbar_dont_user_reserved_dprintf.patch -Patch2: zbar_use_libv4l.patch -Patch3: zbar_choose_supported_format_first.patch +Patch0: zbar_update_to_hg.patch +Patch1: zbar_use_libv4l.patch +Patch2: zbar_choose_supported_format_first.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: ImageMagick-c++ libv4l libXv @@ -88,10 +87,9 @@ scanning widget. %patch0 -p1 %patch1 -p1 %patch2 -p1 -%patch3 -p1 %build -autoreconf +autoreconf -vfi autoconf %configure --docdir=%{_docdir}/%{name}-%{version} @@ -180,6 +178,11 @@ rm -rf $RPM_BUILD_ROOT %{_includedir}/zbar/QZBar*.h %changelog +* Fri Feb 22 2013 Mauro Carvalho Chehab - 0.10-15 +- zbar 0.10 source generated via hg archive -r 0.10 ../zbar-0.10.tar.bz2 + That allows to better handle the difference from 0.10 to -hg +- Update to the latest hg patch + * Fri Feb 15 2013 Fedora Release Engineering - 0.10-14 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild @@ -204,7 +207,7 @@ rm -rf $RPM_BUILD_ROOT * Sun Dec 25 2010 mchehab - 0.10-7 - Prefer to use non-emulated formats -* Sun Dec 05 2010 mchehab - 0.10-6 +* Sun Dec 05 2010 Mauro Carvalho Chehab - Update it to the newest version available at zbar git directory - Use libv4l to communicate with video devices diff --git a/zbar_update_to_617889f8f73.patch b/zbar_update_to_hg.patch similarity index 63% rename from zbar_update_to_617889f8f73.patch rename to zbar_update_to_hg.patch index adf6455..bbe77fb 100644 --- a/zbar_update_to_617889f8f73.patch +++ b/zbar_update_to_hg.patch @@ -1,15 +1,186 @@ -diff --git a/COPYING b/COPYING ---- a/COPYING -+++ b/COPYING +diff -r 563557a923d0 .hgignore +--- a/.hgignore Tue Oct 27 11:25:59 2009 -0400 ++++ b/.hgignore Fri Feb 22 08:54:29 2013 -0300 +@@ -7,7 +7,7 @@ + configure + config + config.guess +-config.h ++config/config.h + config.h.in + config.log + config.status +@@ -19,3 +19,18 @@ + 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 +diff -r 563557a923d0 .hgtags +--- a/.hgtags Tue Oct 27 11:25:59 2009 -0400 ++++ b/.hgtags Fri Feb 22 08:54:29 2013 -0300 +@@ -9,3 +9,21 @@ + 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 +diff -r 563557a923d0 COPYING +--- a/COPYING Tue Oct 27 11:25:59 2009 -0400 ++++ b/COPYING Fri Feb 22 08:54:29 2013 -0300 @@ -1,4 +1,4 @@ -The ZBar Bar Code Reader is Copyright (C) 2007-2009 Jeff Brown -+The ZBar Bar Code Reader is Copyright (C) 2007-2010 Jeff Brown ++The ZBar Bar Code Reader is Copyright (C) 2007-2011 Jeff Brown The QR Code reader is Copyright (C) 1999-2009 Timothy B. Terriberry -diff --git a/Makefile.am b/Makefile.am ---- a/Makefile.am -+++ b/Makefile.am +diff -r 563557a923d0 ChangeLog +--- a/ChangeLog Tue Oct 27 11:25:59 2009 -0400 ++++ b/ChangeLog Fri Feb 22 08:54:29 2013 -0300 +@@ -1,3 +1,95 @@ ++current: ++ * 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 +diff -r 563557a923d0 HACKING +--- a/HACKING Tue Oct 27 11:25:59 2009 -0400 ++++ b/HACKING Fri Feb 22 08:54:29 2013 -0300 +@@ -13,6 +13,12 @@ + 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: + +diff -r 563557a923d0 Makefile.am +--- a/Makefile.am Tue Oct 27 11:25:59 2009 -0400 ++++ b/Makefile.am Fri Feb 22 08:54:29 2013 -0300 @@ -1,6 +1,3 @@ -AM_CPPFLAGS = -I$(srcdir)/include -AM_CFLAGS = -Wall -Wno-parentheses @@ -17,7 +188,7 @@ diff --git a/Makefile.am b/Makefile.am ACLOCAL_AMFLAGS = -I config bin_PROGRAMS = check_PROGRAMS = -@@ -9,8 +6,10 @@ lib_LTLIBRARIES = +@@ -9,8 +6,10 @@ pyexec_LTLIBRARIES = CLEANFILES = DISTCLEANFILES = @@ -28,7 +199,7 @@ diff --git a/Makefile.am b/Makefile.am pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = zbar.pc -@@ -39,6 +38,9 @@ if HAVE_QT +@@ -39,6 +38,9 @@ include $(srcdir)/qt/Makefile.am.inc pkgconfig_DATA += zbar-qt.pc endif @@ -38,7 +209,7 @@ diff --git a/Makefile.am b/Makefile.am if HAVE_NPAPI include $(srcdir)/plugin/Makefile.am.inc endif -@@ -47,11 +49,8 @@ include $(srcdir)/doc/Makefile.am.inc +@@ -47,11 +49,8 @@ EXTRA_DIST += zbar.ico zbar.nsi @@ -52,3668 +223,3832 @@ diff --git a/Makefile.am b/Makefile.am EXTRA_DIST += perl/MANIFEST perl/README perl/Changes perl/COPYING.LIB \ perl/Makefile.PL perl/typemap perl/ZBar.xs perl/ppport.h \ -diff --git a/configure.ac b/configure.ac ---- a/configure.ac -+++ b/configure.ac -@@ -46,6 +46,13 @@ AC_DEFINE_UNQUOTED([LIB_VERSION_REVISION - [[`echo "$LIB_VERSION" | sed -e 's/^[^:]*:\([^:]*\):.*$/\1/'`]], - [Library revision]) - -+AM_CPPFLAGS="-I$srcdir/include" -+AM_CFLAGS="-Wall -Wno-parentheses" -+AM_CXXFLAGS="$AM_CFLAGS" -+AC_SUBST([AM_CPPFLAGS]) -+AC_SUBST([AM_CFLAGS]) -+AC_SUBST([AM_CXXFLAGS]) +diff -r 563557a923d0 README +--- a/README Tue Oct 27 11:25:59 2009 -0400 ++++ b/README Fri Feb 22 08:54:29 2013 -0300 +@@ -4,9 +4,9 @@ + 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 ++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 Qt, GTK and PyGTK. + +diff -r 563557a923d0 README.windows +--- a/README.windows Tue Oct 27 11:25:59 2009 -0400 ++++ b/README.windows Fri Feb 22 08:54:29 2013 -0300 +@@ -3,8 +3,8 @@ + + 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 +diff -r 563557a923d0 TODO +--- a/TODO Tue Oct 27 11:25:59 2009 -0400 ++++ b/TODO Fri Feb 22 08:54:29 2013 -0300 +@@ -25,7 +25,6 @@ + * 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) +diff -r 563557a923d0 android/AndroidManifest.xml +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/android/AndroidManifest.xml Fri Feb 22 08:54:29 2013 -0300 +@@ -0,0 +1,15 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff -r 563557a923d0 android/ChangeLog +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/android/ChangeLog Fri Feb 22 08:54:29 2013 -0300 +@@ -0,0 +1,2 @@ ++version 0.1: ++ * Add initial support for Android platform +diff -r 563557a923d0 android/README +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/android/README Fri Feb 22 08:54:29 2013 -0300 +@@ -0,0 +1,112 @@ ++ZBar Android SDK ++================ + - dnl windows build - - AC_CANONICAL_HOST -@@ -73,13 +80,36 @@ documentation generation]) - AC_ARG_VAR([XMLTOFLAGS], [additional arguments for xmlto]) - AC_CHECK_PROGS([XMLTO], [xmlto], [:]) - -+have_java="maybe" -+AC_ARG_VAR([JAVA_HOME], [root location of JDK]) -+AS_IF([test "x$JAVA_HOME" = "x"], -+ [JAVA_PATH="$PATH"], -+ [JAVA_PATH="$JAVA_HOME/bin$PATH_SEPARATOR$PATH"]) ++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. + -+AC_ARG_VAR([JAVAC], [location of Java language compiler]) -+AC_PATH_PROGS([JAVAC], [javac jikes ecj gcj], [:], [$JAVA_PATH]) -+AS_IF([test "x$JAVAC" = "x:"], [have_java="no"]) ++Check the ZBar home page for the latest release, mailing lists, etc. ++ http://zbar.sourceforge.net/ + -+AC_ARG_VAR([JAVAH], [location of Java header generator]) -+AC_PATH_PROGS([JAVAH], [javah], [/bin/false], [$JAVA_PATH]) ++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 + -+AC_ARG_VAR([JAR], [location of Java archive tool]) -+AC_PATH_PROGS([JAR], [jar], [:], [$JAVA_PATH]) -+AS_IF([test "x$JAR" = "x:"], [have_java="no"]) ++Copyright 2008-2012 © Jeff Brown et al + -+AC_ARG_VAR([JAVA], [location of Java application launcher]) -+AC_PATH_PROGS([JAVA], [java], [/bin/false], [$JAVA_PATH]) ++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 + -+AC_ARG_VAR([CLASSPATH], [Java class path (include JUnit to run java tests)]) -+AS_IF([test "x$CLASSPATH" = "x"], [CLASSPATH="."]) ++See included files COPYING and LICENSE for details. + - dnl symbologies - - AC_ARG_ENABLE([codes], - [AS_HELP_STRING([--enable-codes=SYMS], -- [select symbologies to compile [default=ean,i25,code39,code128,qrcode]])], -+ [select symbologies to compile [default=ean,databar,code128,code93,code39,i25,qrcode]])], - [], -- [enable_codes="ean,code39,code128,i25,qrcode"]) dnl pdf417 -+ [enable_codes="ean,databar,code128,code93,code39,i25,qrcode"]) - - AC_DEFUN([ZBAR_CHK_CODE], [ - AC_MSG_CHECKING([whether to build $2]) -@@ -97,11 +127,13 @@ AC_DEFUN([ZBAR_CHK_CODE], [ - ])dnl - - ZBAR_CHK_CODE([ean], [EAN symbologies]) -+ZBAR_CHK_CODE([databar], [DataBar symbology]) - ZBAR_CHK_CODE([code128], [Code 128 symbology]) -+ZBAR_CHK_CODE([code93], [Code 93 symbology]) - ZBAR_CHK_CODE([code39], [Code 39 symbology]) --ZBAR_CHK_CODE([pdf417], [PDF417 symbology]) - ZBAR_CHK_CODE([i25], [Interleaved 2 of 5 symbology]) - ZBAR_CHK_CODE([qrcode], [QR Code]) -+ZBAR_CHK_CODE([pdf417], [PDF417 symbology]) - - dnl libraries - -@@ -255,7 +287,7 @@ AM_CONDITIONAL([HAVE_JPEG], [test "x$wit - dnl ImageMagick - AC_ARG_WITH([imagemagick], - [AS_HELP_STRING([--without-imagemagick], -- [disable support for scanning images using ImageMagick])], -+ [disable support for scanning images with ImageMagick])], - [], - [with_imagemagick="yes"]) - -@@ -296,7 +328,7 @@ AM_CONDITIONAL([HAVE_MAGICK], [test "x$w - dnl Mozilla NPAPI - AC_ARG_WITH([npapi], - [AS_HELP_STRING([--with-npapi], -- [enable support for Firefox/Mozilla/OpenOffice NPAPI plugin])], -+ [enable support for Firefox/Mozilla/OpenOffice plugin])], - [], - [with_npapi="no"]) - -@@ -383,13 +415,38 @@ AS_IF([test "x$with_qt" != "xno"], - - AM_CONDITIONAL([HAVE_QT], [test "x$with_qt" = "xyes"]) - -+dnl Java -+AC_ARG_WITH([java], -+ [AS_HELP_STRING([--without-java], -+ [disable support for Java interface])], -+ [], -+ [with_java="check"]) + -+AC_ARG_VAR([JAVA_CFLAGS], [compiler flags for building JNI extensions]) -+AS_IF([test "x$JAVA_CFLAGS" = "x" && test "x$JAVA_HOME" != "x"], -+ [JAVA_CFLAGS="-I$JAVA_HOME/include"]) ++Installation ++------------ + -+AS_IF([test "x$with_java" != "xno"], -+ [CPPFLAGS_save="$CPPFLAGS" -+ CPPFLAGS="$CPPFLAGS $JAVA_CFLAGS" -+ AC_CHECK_HEADER([jni.h], [], [have_java="no"]) -+ CPPFLAGS="$CPPFLAGS_save" -+ AS_IF([test "x$have_java" != "xno"], -+ [with_java="yes"], -+ [test "x$with_java" = "xyes"], -+ [AC_MSG_FAILURE([unable to find Java JNI! ensure CFLAGS are set -+appropriately or configure --without-java])], -+ [with_java="no"]) -+]) -+AM_CONDITIONAL([HAVE_JAVA], [test "x$with_java" = "xyes"]) ++After downloading the ZBar-Android-Lib-.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 ++ cp -r ZBar-Android-SDK-/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-/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. + - - dnl header files - - dnl FIXME switches for shm, mmap - AC_HEADER_ASSERT --AC_CHECK_HEADERS([fcntl.h features.h inttypes.h stdlib.h string.h unistd.h \ -- sys/ioctl.h sys/time.h sys/times.h sys/ipc.h sys/shm.h sys/mman.h]) -+AC_CHECK_HEADERS([errno.h fcntl.h features.h inttypes.h stdlib.h string.h \ -+ unistd.h sys/ioctl.h sys/time.h sys/times.h sys/ipc.h sys/shm.h sys/mman.h]) - - dnl types - -@@ -428,6 +485,7 @@ AC_CONFIG_COMMANDS([doc/reldate.xml], - - AC_CONFIG_FILES([ - Makefile -+java/Makefile - zbar.pc - zbar-gtk.pc - zbar-qt.pc -@@ -460,6 +518,9 @@ AS_IF([test "x$with_gtk" != "xyes"], - echo "Qt4 --with-qt=$with_qt" - AS_IF([test "x$with_qt" != "xyes"], - [echo " => the Qt4 widget will *NOT* be built"]) -+echo "Java --with-java=$with_java" -+AS_IF([test "x$with_java" != "xyes"], -+ [echo " => the Java interface will *NOT* be built"]) - #echo "NPAPI Plugin --with-npapi=$with_npapi" - #AS_IF([test "x$with_mozilla" != "xyes"], - # [echo " => the Mozilla/Firefox/OpenOffice plugin will *NOT* be built"]) -diff --git a/doc/Makefile.am.inc b/doc/Makefile.am.inc ---- a/doc/Makefile.am.inc -+++ b/doc/Makefile.am.inc -@@ -2,6 +2,7 @@ - DOCSOURCES = doc/manual.xml doc/version.xml doc/reldate.xml \ - doc/ref/zbarimg.xml doc/ref/zbarcam.xml doc/ref/commonoptions.xml - -+MAINTAINERCLEANFILES += doc/man/man.stamp doc/version.xml doc/reldate.xml - - # man page targets to distribute and install - dist_man_MANS = -diff --git a/doc/api/footer.html b/doc/api/footer.html ---- a/doc/api/footer.html -+++ b/doc/api/footer.html -@@ -9,9 +9,12 @@ - -
spadix@users.sourceforge.net
- --

Copyright 2008-2009 (c) Jeff Brown - All Rights Reserved.

--

Verbatim copying and distribution of this entire article are -- permitted worldwide, without royalty, in any medium, provided this -- notice, and the copyright notice, are preserved.

-+

Copyright 2008-2010 (c) Jeff Brown

-+

This documentation is part of the ZBar Barcode Reader; you can -+redistribute it and/or modify it under the terms of the -+GNU -+Lesser General Public License as published by the Free Software -+Foundation; either version 2.1 of the License, or (at your option) any -+later version.

- - -diff --git a/doc/manual.xml b/doc/manual.xml ---- a/doc/manual.xml -+++ b/doc/manual.xml -@@ -29,10 +29,10 @@ - 2007 - 2008 - 2009 -+ 2010 - Jeff Brown - - All Rights Reserved -- - - - -@@ -47,7 +47,4 @@ - &refzbarimg; - - -- -- -- - -diff --git a/doc/ref/commonoptions.xml b/doc/ref/commonoptions.xml ---- a/doc/ref/commonoptions.xml -+++ b/doc/ref/commonoptions.xml -@@ -47,8 +47,9 @@ - , , - , , - , , -- , , -- or the special value . -+ , , , -+ , -+ or the special value . - If symbology is - omitted or , the config will be set for all -diff --git a/doc/ref/zbarcam.xml b/doc/ref/zbarcam.xml ---- a/doc/ref/zbarcam.xml -+++ b/doc/ref/zbarcam.xml -@@ -60,9 +60,10 @@ - /dev/video0 - - The underlying library currently supports EAN-13 (including -- UPC and ISBN subsets), EAN-8, Code 128, Code 39, and Interleaved -- 2 of 5 symbologies. The specific type of each detected symbol is -- printed with the decoded data. -+ UPC and ISBN subsets), EAN-8, DataBar, DataBar Expanded, Code 128, -+ Code 93, Code 39, Interleaved 2 of 5 and QR Code symbologies. The -+ specific type of each detected symbol is printed with the decoded -+ data. - - - -@@ -160,6 +161,37 @@ - - - -+ Exit Status ++Building ++-------- + -+ zbarcam returns an exit code to indicate the -+ status of the program execution. Current exit codes are: ++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. + -+ -+ -+ 0 -+ -+ Successful program completion. -+ -+ ++Documentation ++------------- ++ TDB + -+ -+ 1 -+ -+ An error occurred. This includes bad arguments and I/O -+ errors. -+ -+ ++Examples ++-------- + -+ -+ 2 -+ -+ A fatal error occurred. -+ -+ -+ -+ ++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 /examples/CameraTest ++ 2) android update project --path . ++ 3) ant debug install + -+ - See Also - - -diff --git a/doc/ref/zbarimg.xml b/doc/ref/zbarimg.xml ---- a/doc/ref/zbarimg.xml -+++ b/doc/ref/zbarimg.xml -@@ -59,9 +59,10 @@ - displayed to the screen. - - The underlying library currently supports EAN-13 (including -- UPC and ISBN subsets), EAN-8, Code 128, Code 39, and Interleaved -- 2 of 5 symbologies. The specific type of each detected symbol is -- printed with the decoded data. -+ UPC and ISBN subsets), EAN-8, DataBar, DataBar Expanded, Code 128, -+ Code 93, Code 39, Interleaved 2 of 5 and QR Code symbologies. The -+ specific type of each detected symbol is printed with the decoded -+ data. - - Note that "image" - -@@ -166,6 +167,56 @@ - - - -+ Exit Status ++If you have problems with this, please create a new Android project ++and copy the necessary files from the examples. + -+ zbarimg returns an exit code to indicate the -+ status of the program execution. Current exit codes are: ++examples/CameraTest is a simple demonstration of how to integrate the ++ZBar image scanner with the camera. + -+ -+ -+ 0 -+ -+ Barcodes successfully detected in all images. Warnings may -+ have been generated, but no errors. -+ -+ ++Manually building ZBar JNI library ++---------------------------------- ++First download and unzip the iconv library source from ++ http://www.gnu.org/software/libiconv/ + -+ -+ 1 -+ -+ An error occurred while processing some image(s). This -+ includes bad arguments, I/O errors and image handling errors from -+ ImageMagick. -+ -+ ++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. + -+ -+ 2 -+ -+ ImageMagick fatal error. -+ -+ ++ 1) cd /android ++ 2) android update project --path . ++ 3) ant -Dndk.dir= -Diconv.src= zbar-all + -+ -+ 3 -+ -+ The user quit the program before all images were scanned. -+ Only applies when running in interactive mode -+ (with ) -+ -+ ++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". + -+ -+ 4 -+ -+ No barcode was detected in one or more of the images. No -+ other errors occurred. -+ -+ -+ -+ ++To clean run: ++ ant -Dndk.dir= zbar-clean + -+ - See Also - - -diff --git a/examples/paginate.pl b/examples/paginate.pl -deleted file mode 100755 ---- a/examples/paginate.pl -+++ /dev/null -@@ -1,71 +0,0 @@ --#!/usr/bin/perl --#------------------------------------------------------------------------ --# Copyright 2009 (c) Jeff Brown --# --# This file is part of the ZBar Bar Code Reader. --# --# The ZBar Bar Code Reader is free software; you can redistribute it --# and/or modify it under the terms of the GNU Lesser Public License as --# published by the Free Software Foundation; either version 2.1 of --# the License, or (at your option) any later version. --# --# The ZBar Bar Code Reader is distributed in the hope that it will be --# useful, but WITHOUT ANY WARRANTY; without even the implied warranty --# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --# GNU Lesser Public License for more details. --# --# You should have received a copy of the GNU Lesser Public License --# along with the ZBar Bar Code Reader; if not, write to the Free --# Software Foundation, Inc., 51 Franklin St, Fifth Floor, --# Boston, MA 02110-1301 USA --# --# http://sourceforge.net/projects/zbar --#------------------------------------------------------------------------ --use warnings; --use strict; -- --use Barcode::ZBar; --use Image::Magick; -- --warn("no input files specified?\n") if(!@ARGV); -- --# running output document --my $out = undef; -- --# barcode scanner --my $scanner = Barcode::ZBar::ImageScanner->new(); -- --foreach my $file (@ARGV) { -- print "scanning from \"$file\"\n"; -- my $imseq = Image::Magick->new(); -- my $err = $imseq->Read($file); -- warn($err) if($err); -- -- foreach my $page (@$imseq) { -- # convert ImageMagick page to ZBar image -- my $zimg = Barcode::ZBar::Image->new(); -- $zimg->set_format('Y800'); -- $zimg->set_size($page->Get(qw(columns rows))); -- $zimg->set_data($page->Clone()->ImageToBlob(magick => 'GRAY', depth => 8)); -- -- # scan for barcodes -- if($scanner->scan_image($zimg)) { -- # write out previous document -- $out->write() if($out); -- -- # use first symbol found to name next image (FIXME sanitize) -- my $data = ($zimg->get_symbols())[0]->get_data(); -- my $idx = $page->Get('scene') + 1; -- print "splitting $data from page $idx\n"; -- -- # create new output document -- $out = Image::Magick->new(filename => $data); -- } -- -- # append this page to current output -- push(@$out, $page) if($out); -- } -- -- # write out final document -- $out->write() if($out); --} -diff --git a/examples/processor.c b/examples/processor.c -new file mode 100644 ---- /dev/null -+++ b/examples/processor.c -@@ -0,0 +1,47 @@ -+#include -+#include ++See build-ndk.xml for additional target options. + -+static void my_handler (zbar_image_t *image, -+ const void *userdata) -+{ -+ /* extract results */ -+ const zbar_symbol_t *symbol = zbar_image_first_symbol(image); -+ for(; symbol; symbol = zbar_symbol_next(symbol)) { -+ /* do something useful with results */ -+ zbar_symbol_type_t typ = zbar_symbol_get_type(symbol); -+ const char *data = zbar_symbol_get_data(symbol); -+ printf("decoded %s symbol \"%s\"\n", -+ zbar_get_symbol_name(typ), data); -+ } -+} + -+int main (int argc, char **argv) -+{ -+ const char *device = "/dev/video0"; +diff -r 563557a923d0 android/ant.properties +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/android/ant.properties Fri Feb 22 08:54:29 2013 -0300 +@@ -0,0 +1,17 @@ ++# 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. ++ +diff -r 563557a923d0 android/build-ndk.xml +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/android/build-ndk.xml Fri Feb 22 08:54:29 2013 -0300 +@@ -0,0 +1,66 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff -r 563557a923d0 android/build.xml +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/android/build.xml Fri Feb 22 08:54:29 2013 -0300 +@@ -0,0 +1,86 @@ ++ ++ + -+ /* create a Processor */ -+ zbar_processor_t *proc = zbar_processor_create(1); ++ ++ + -+ /* configure the Processor */ -+ zbar_processor_set_config(proc, 0, ZBAR_CFG_ENABLE, 1); ++ ++ + -+ return(0); ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff -r 563557a923d0 android/examples/CameraTest/AndroidManifest.xml +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/android/examples/CameraTest/AndroidManifest.xml Fri Feb 22 08:54:29 2013 -0300 +@@ -0,0 +1,19 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff -r 563557a923d0 android/examples/CameraTest/ant.properties +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/android/examples/CameraTest/ant.properties Fri Feb 22 08:54:29 2013 -0300 +@@ -0,0 +1,17 @@ ++# 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. ++ +diff -r 563557a923d0 android/examples/CameraTest/build.xml +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/android/examples/CameraTest/build.xml Fri Feb 22 08:54:29 2013 -0300 +@@ -0,0 +1,85 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff -r 563557a923d0 android/examples/CameraTest/proguard.cfg +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/android/examples/CameraTest/proguard.cfg Fri Feb 22 08:54:29 2013 -0300 +@@ -0,0 +1,40 @@ ++-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 ; +} -diff --git a/examples/processor.cpp b/examples/processor.cpp -new file mode 100644 ---- /dev/null -+++ b/examples/processor.cpp -@@ -0,0 +1,45 @@ -+#include -+#include + -+using namespace std; -+using namespace zbar; ++-keepclasseswithmembers class * { ++ public (android.content.Context, android.util.AttributeSet); ++} + -+class MyHandler : public Image::Handler -+{ -+ void image_callback (Image &image) -+ { -+ for(SymbolIterator symbol = image.symbol_begin(); -+ symbol != image.symbol_end(); -+ ++symbol) -+ cout << "decoded " << symbol->get_type_name() << " symbol " -+ << "\"" << symbol->get_data() << "\"" << endl; -+ } -+}; ++-keepclasseswithmembers class * { ++ public (android.content.Context, android.util.AttributeSet, int); ++} + -+int main (int argc, char **argv) -+{ -+ // create and initialize a Processor -+ const char *device = "/dev/video0"; -+ if(argc > 1) -+ device = argv[1]; -+ Processor proc(true, device); ++-keepclassmembers class * extends android.app.Activity { ++ public void *(android.view.View); ++} + -+ // configure the Processor -+ proc.set_config(ZBAR_NONE, ZBAR_CFG_ENABLE, 1); ++-keepclassmembers enum * { ++ public static **[] values(); ++ public static ** valueOf(java.lang.String); ++} + -+ // setup a callback -+ MyHandler my_handler; -+ proc.set_handler(my_handler); ++-keep class * implements android.os.Parcelable { ++ public static final android.os.Parcelable$Creator *; ++} +diff -r 563557a923d0 android/examples/CameraTest/project.properties +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/android/examples/CameraTest/project.properties Fri Feb 22 08:54:29 2013 -0300 +@@ -0,0 +1,11 @@ ++# 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 +diff -r 563557a923d0 android/examples/CameraTest/res/layout/main.xml +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/android/examples/CameraTest/res/layout/main.xml Fri Feb 22 08:54:29 2013 -0300 +@@ -0,0 +1,28 @@ ++ ++ ++ ++ ++ ++ ++ ++