This commit is contained in:
commit
c60026ecbe
1
.github/workflows/ci.yml
vendored
1
.github/workflows/ci.yml
vendored
@ -154,7 +154,6 @@ jobs:
|
||||
#
|
||||
# Mac OS
|
||||
#
|
||||
|
||||
Mac_OS:
|
||||
name: Mac OS
|
||||
runs-on: macos-latest
|
||||
|
||||
22
.github/workflows/debuilder.sh
vendored
22
.github/workflows/debuilder.sh
vendored
@ -15,26 +15,26 @@ BUILDDIR=${ZBARDIR}/../build
|
||||
|
||||
echo "Generating an origin tarball"
|
||||
|
||||
cd ${ZBARDIR}
|
||||
cd "${ZBARDIR}"
|
||||
|
||||
VER=$(cat ${ZBARDIR}/configure.ac|grep AC_INIT|perl -ne 'print $1 if /(\d+[.\d]+)/')
|
||||
VER=$(cat "${ZBARDIR}/configure.ac" | grep AC_INIT | perl -ne 'print $1 if /(\d+[.\d]+)/')
|
||||
TAR=${ZBARDIR}/../zbar_${VER}.orig.tar.gz
|
||||
|
||||
git archive --format tgz -o ${TAR} HEAD
|
||||
git archive --format tgz -o "${TAR}" HEAD
|
||||
|
||||
echo "Retrieving Debian ruleset"
|
||||
lftp -e "mget -c ${DEB_FNAME}; exit" ${DEB_URL}
|
||||
lftp -e "mget -c ${DEB_FNAME}; exit" "${DEB_URL}"
|
||||
|
||||
# Ensure to use just one version, in case multiple ones were downloaded
|
||||
DEB_FNAME=$(ls -1 ${DEB_FNAME}|tail -1)
|
||||
DEB_FNAME=$(ls -1 ${DEB_FNAME} | tail -1)
|
||||
|
||||
echo "Preparing build environment"
|
||||
rm -rf ${BUILDDIR}/ | true
|
||||
mkdir -p ${BUILDDIR}
|
||||
cd ${BUILDDIR}
|
||||
rm -rf "${BUILDDIR}/" || true
|
||||
mkdir -p "${BUILDDIR}"
|
||||
cd "${BUILDDIR}"
|
||||
|
||||
tar xf ${TAR}
|
||||
tar xf ${ZBARDIR}/${DEB_FNAME}
|
||||
tar xf "${TAR}"
|
||||
tar xf "${ZBARDIR}/${DEB_FNAME}"
|
||||
|
||||
# Ensure that debhelper-compat will use the one expected by the build distro
|
||||
sed -E "s#debhelper-compat.*,#debhelper-compat (= $COMPAT),#" -i debian/control
|
||||
@ -56,7 +56,7 @@ zbar (${VER}) unstable; urgency=medium
|
||||
-- LinuxTV bot <linuxtv-commits@linuxtv.org> $(date -R)
|
||||
EOF
|
||||
|
||||
OS_VERSION=$(. /etc/os-release && echo $ID-$VERSION_ID)
|
||||
OS_VERSION=$(. /etc/os-release && echo "$ID-$VERSION_ID")
|
||||
|
||||
echo "Building ZBar packages for ${OS_VERSION}"
|
||||
debuild -us -uc
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -18,6 +18,7 @@ x64/
|
||||
.deps/
|
||||
.dirstamp
|
||||
.libs/
|
||||
build/
|
||||
|
||||
ABOUT-NLS
|
||||
aclocal.m4
|
||||
|
||||
@ -11,7 +11,7 @@ set(ZBAR_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE INTERNAL "zbar root director
|
||||
|
||||
if (MSVC)
|
||||
# "-DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake"
|
||||
find_package(iconv REQUIRED)
|
||||
find_package(Iconv REQUIRED)
|
||||
find_package(JPEG REQUIRED)
|
||||
find_package(libpng CONFIG REQUIRED)
|
||||
find_package(ZLIB REQUIRED)
|
||||
|
||||
@ -709,7 +709,7 @@ version 0.2:
|
||||
- moved EAN/UPC specific decoding into it's own module
|
||||
* fix confusing configure behavior which quietly avoided building
|
||||
targets with missing dependencies(?!)
|
||||
configure will now fail with a descriptive error message if you
|
||||
configure will now fail with a descriptive error message if you
|
||||
do not have Magick++ and fail to specify --without-imagemagick or
|
||||
do not have SDL and fail to specify --without-sdl
|
||||
* add configure summary describing what will be built (req #1698196)
|
||||
|
||||
24
HACKING.md
24
HACKING.md
@ -22,7 +22,7 @@ Gitlab:
|
||||
You can use git clone to get the latest version from any of the
|
||||
above repositories.
|
||||
|
||||
if you haven't already, grab the ZBar git repository. For example, to
|
||||
If you haven't already, grab the ZBar git repository. For example, to
|
||||
get it from Github, use:
|
||||
|
||||
git clone https://github.com/mchehab/zbar.git
|
||||
@ -30,19 +30,21 @@ get it from Github, use:
|
||||
autoreconf -vfi
|
||||
|
||||
This will generate ./configure and all that other foo you usually get with
|
||||
a release. you will need to have recent versions of some basic "developer
|
||||
a release. You will need to have recent versions of some basic "developer
|
||||
tools" installed in order for this to work, particularly GNU autotools.
|
||||
these versions of autotools are known to work (newer versions should also
|
||||
These versions of autotools are known to work (newer versions should also
|
||||
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
|
||||
|
||||
All above mentioned tools (except xmlto) must be installed in the same
|
||||
prefix. Mixing prefixes (e.g. /usr/bin and /usr/local/bin) may lead to
|
||||
errors in configuration stages.
|
||||
|
||||
Writing descriptions for your patches
|
||||
=====================================
|
||||
@ -60,7 +62,7 @@ In practice, please add:
|
||||
|
||||
Signed-off-by: your name <your@email>
|
||||
|
||||
on your pathes.
|
||||
on your patches.
|
||||
|
||||
Submitting patches
|
||||
==================
|
||||
@ -72,7 +74,7 @@ patches and then push again to your clone, asking the patch merge using
|
||||
the GUI.
|
||||
|
||||
Although we prefer if you submit patches via either Github or
|
||||
Gitlab, you can also submit them via e-mail to:
|
||||
Gitlab, you can also submit them via e-mail to:
|
||||
|
||||
linux-media@vger.kernel.org
|
||||
|
||||
@ -80,11 +82,9 @@ If you opt to do so, please place [PATCH ZBar] at the subject of
|
||||
your e-mails for us to not mix them with patches for the Kernel
|
||||
or for other media tools.
|
||||
|
||||
To make your patch, run:
|
||||
|
||||
and want to make your patch, run:
|
||||
|
||||
git diff > hacked.patch
|
||||
|
||||
git diff > hacked.patch
|
||||
|
||||
Other things for you to read, in order to know more about how
|
||||
to submit your work for upstreaming processes in general, that
|
||||
|
||||
2
NEWS.md
2
NEWS.md
@ -35,7 +35,7 @@ Version 0.21 (2019-02-12)
|
||||
|
||||
Added support for SQ code, and the ability of compiling ZBar with the
|
||||
LLVM/Clang compiler. Several bugs fixes and enhancements are also found
|
||||
in this release; qexisting users are encouraged to upgrade.
|
||||
in this release; existing users are encouraged to upgrade.
|
||||
|
||||
Version 0.20.1 (2018-08-08)
|
||||
===========================
|
||||
|
||||
@ -6,7 +6,7 @@ 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 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
|
||||
(e.g. 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.
|
||||
|
||||
@ -133,13 +133,13 @@ Building on Ubuntu Bionic
|
||||
You need to install the following packages:
|
||||
|
||||
sudo apt-get install -y \
|
||||
autoconf automake autotools-dev libdbus-1-dev \
|
||||
pkg-config binutils-mingw-w64-i686 gcc-mingw-w64 \
|
||||
mingw-w64-i686-dev mingw-w64-common win-iconv-mingw-w64-dev \
|
||||
xmlto
|
||||
|
||||
Then, build Zbar with:
|
||||
|
||||
autoconf automake autotools-dev libdbus-1-dev \
|
||||
pkg-config binutils-mingw-w64-i686 gcc-mingw-w64 \
|
||||
mingw-w64-i686-dev mingw-w64-common win-iconv-mingw-w64-dev \
|
||||
xmlto autopoint
|
||||
|
||||
Then, build Zbar with:
|
||||
|
||||
export PKG_CONFIG_PATH=/usr/x86_64-w64-mingw32/lib/pkgconfig
|
||||
|
||||
autoreconf -vfi
|
||||
@ -166,13 +166,13 @@ With Cocolatey installed, ensure that you have minGw and needed deps with:
|
||||
|
||||
choco install -r --no-progress -y msys2 make
|
||||
|
||||
Then use pacman to install the needed packages:
|
||||
|
||||
pacman -Syu --noconfirm autoconf libtool automake make \
|
||||
autoconf-archive pkg-config
|
||||
|
||||
Once you have everything needed and set the PATH to the places where the
|
||||
building environment is, you can build ZBar with:
|
||||
Then use pacman to install the needed packages:
|
||||
|
||||
pacman -Syu --noconfirm autoconf libtool automake make \
|
||||
autoconf-archive pkg-config autopoint gettext-devel
|
||||
|
||||
Once you have everything needed and set the PATH to the places where the
|
||||
building environment is, you can build ZBar with:
|
||||
|
||||
autoreconf -vfi
|
||||
|
||||
@ -241,7 +241,7 @@ To start the webcam reader using the default camera, type:
|
||||
|
||||
zbarcam
|
||||
|
||||
To decode an image file, type eg:
|
||||
To decode an image file, type e.g.:
|
||||
|
||||
zbarimg -d examples\barcode.png
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ 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 SQ 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.
|
||||
code images and using a video device (e.g. 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.
|
||||
|
||||
|
||||
@ -12,4 +12,4 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
||||
</manifest>
|
||||
|
||||
@ -19,7 +19,7 @@ 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
|
||||
supporting libraries, 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.
|
||||
@ -47,11 +47,11 @@ 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".
|
||||
ZBar-Android-SDK-<version>/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
|
||||
@ -61,9 +61,9 @@ 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"
|
||||
You are all set; ant will automatically find jar files under the "libs"
|
||||
subdirectory.
|
||||
|
||||
Documentation
|
||||
@ -88,7 +88,7 @@ ZBar image scanner with the camera.
|
||||
|
||||
Manually building ZBar JNI library
|
||||
----------------------------------
|
||||
First download and unzip the iconv library source from
|
||||
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
|
||||
@ -96,7 +96,7 @@ 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 .
|
||||
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
|
||||
@ -108,5 +108,3 @@ To clean run:
|
||||
ant -Dndk.dir=<NDK path> zbar-clean
|
||||
|
||||
See build-ndk.xml for additional target options.
|
||||
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<!--
|
||||
<!--
|
||||
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
|
||||
@ -63,4 +63,3 @@ targets:
|
||||
</zip>
|
||||
</target>
|
||||
</project>
|
||||
|
||||
|
||||
@ -16,4 +16,4 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
</manifest>
|
||||
</manifest>
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
<TextView
|
||||
android:id="@+id/scanText"
|
||||
android:text="Scanning..."
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent">
|
||||
</TextView>
|
||||
<Button
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Barebones implementation of displaying camera preview.
|
||||
*
|
||||
*
|
||||
* Created by lisah0 on 2012-02-24
|
||||
*/
|
||||
package net.sourceforge.zbar.android.CameraTest;
|
||||
@ -39,7 +39,7 @@ public class CameraPreview extends SurfaceView implements SurfaceHolder.Callback
|
||||
previewCallback = previewCb;
|
||||
autoFocusCallback = autoFocusCb;
|
||||
|
||||
/*
|
||||
/*
|
||||
* Set camera to continuous focus if supported, otherwise use
|
||||
* software auto-focus. Only works for API level >=9.
|
||||
*/
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* 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;
|
||||
@ -52,7 +52,7 @@ public class CameraTestActivity extends Activity
|
||||
|
||||
static {
|
||||
System.loadLibrary("iconv");
|
||||
}
|
||||
}
|
||||
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@ -131,12 +131,12 @@ public class CameraTestActivity extends Activity
|
||||
barcode.setData(data);
|
||||
|
||||
int result = scanner.scanImage(barcode);
|
||||
|
||||
|
||||
if (result != 0) {
|
||||
previewing = false;
|
||||
mCamera.setPreviewCallback(null);
|
||||
mCamera.stopPreview();
|
||||
|
||||
|
||||
SymbolSet syms = scanner.getResults();
|
||||
for (Symbol sym : syms) {
|
||||
scanText.setText("barcode result " + sym.getData());
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#
|
||||
# Android NDK makefile
|
||||
# Android NDK makefile
|
||||
#
|
||||
# build - <ndk path>/ndk-build ICONV_SRC=<iconv library src>
|
||||
# build - <ndk path>/ndk-build ICONV_SRC=<iconv library src>
|
||||
# clean - <ndk path>/ndk-build clean
|
||||
#
|
||||
MY_LOCAL_PATH := $(call my-dir)
|
||||
@ -69,8 +69,8 @@ LOCAL_SRC_FILES := ../../java/zbarjni.c \
|
||||
|
||||
LOCAL_C_INCLUDES := ../include \
|
||||
../zbar \
|
||||
$(ICONV_SRC)/include
|
||||
$(ICONV_SRC)/include
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := libiconv
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
@ -4,9 +4,9 @@
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
>
|
||||
<TextView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
<TextView
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Hello World, ACTIVITY_ENTRY_NAME"
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
77
configure.ac
77
configure.ac
@ -1,7 +1,7 @@
|
||||
changecom()dnl
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_PREREQ([2.68])
|
||||
AC_INIT([zbar], [0.23.92], [mchehab+huawei@kernel.org])
|
||||
AC_INIT([zbar],[0.23.92],[mchehab+huawei@kernel.org])
|
||||
m4_ifndef([AC_LANG_DEFINES_PROVIDED],
|
||||
[m4_define([AC_LANG_DEFINES_PROVIDED])])
|
||||
AC_CONFIG_AUX_DIR(config)
|
||||
@ -85,7 +85,6 @@ dnl programs
|
||||
AC_PROG_CC
|
||||
AM_PROG_CC_C_O
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CC_STDC
|
||||
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
@ -329,8 +328,7 @@ AS_IF([test "x$with_dbus" = "xyes"],
|
||||
[CPPFLAGS="$CPPFLAGS $DBUS_CFLAGS"
|
||||
AC_ARG_VAR([DBUS_LIBS], [linker flags for building dbus])
|
||||
AC_DEFINE([HAVE_DBUS], [1], [Define to 1 to use dbus])
|
||||
AC_ARG_WITH(dbusconfdir, AC_HELP_STRING([--with-dbusconfdir=PATH],
|
||||
[path to D-Bus config directory]),
|
||||
AC_ARG_WITH(dbusconfdir, AS_HELP_STRING([--with-dbusconfdir=PATH],[path to D-Bus config directory]),
|
||||
[path_dbusconf=$withval],
|
||||
[path_dbusconf="`$PKG_CONFIG --variable=sysconfdir dbus-1`"])
|
||||
AS_IF([test -z "$path_dbusconf"],
|
||||
@ -656,51 +654,46 @@ AC_ARG_WITH([qt],
|
||||
[],
|
||||
[with_qt="yes"])
|
||||
|
||||
dnl Qt5
|
||||
AC_ARG_WITH([qt5],
|
||||
[AS_HELP_STRING([--without-qt5],
|
||||
[disable support for Qt5 widget. if --with-qt, it will seek only for Qt4])],
|
||||
dnl Qt6
|
||||
AC_ARG_WITH([qt6],
|
||||
[AS_HELP_STRING([--with-qt6],
|
||||
[If --with-qt, enable experimental support for Qt6 widget (currently broken)])],
|
||||
[],
|
||||
[with_qt5="yes"])
|
||||
[with_qt6="no"])
|
||||
|
||||
AS_IF([test "x$with_qt" != "xno"],
|
||||
[AS_IF([test "x$with_qt6" != "xno"],
|
||||
PKG_CHECK_MODULES([QT],
|
||||
[Qt6],
|
||||
[MOC=`pkg-config Qt6 --variable=moc`
|
||||
QT_VERSION=`$PKG_CONFIG Qt6 --modversion`
|
||||
QT6_HEADERS=`pkg-config Qt6 --variable=headerdir`
|
||||
CPPFLAGS="$CPPFLAGS -I$QT6_HEADERS -I$QT6_HEADERS/QtWidgets -I$QT6_HEADERS/QtCore -I$QT6_HEADERS/QtGui"
|
||||
qt_pkgconfig_file="zbar-qt5.pc"
|
||||
],
|
||||
[with_qt6="no"]))
|
||||
AS_IF([test "x$with_qt6" = "xno"],
|
||||
PKG_CHECK_MODULES([QT],
|
||||
[Qt5Core >= 5 Qt5Gui >= 5 Qt5Widgets >= 5.0 Qt5X11Extras >= 5.0],
|
||||
[MOC=`pkg-config Qt5 --variable=moc`
|
||||
QT_VERSION=`$PKG_CONFIG Qt5 --modversion`
|
||||
qt_pkgconfig_file="zbar-qt5.pc"
|
||||
],
|
||||
[with_qt="no"]))
|
||||
])
|
||||
|
||||
AC_ARG_VAR([MOC], [full path to Qt moc program])
|
||||
|
||||
AS_IF([test "x$have_x" = "xyes"],
|
||||
[qt_extra="Qt5X11Extras >= 5.0"],
|
||||
[qt_extra=""])
|
||||
|
||||
AS_IF([test "x$with_qt" != "xno"],
|
||||
[PKG_CHECK_MODULES([QT],
|
||||
[Qt5Core >= 5 Qt5Gui >= 5 Qt5Widgets >= 5.0 $qt_extra],,
|
||||
[with_qt5="no"
|
||||
PKG_CHECK_MODULES([QT],
|
||||
[QtCore >= 4 QtGui >= 4],,
|
||||
[with_qt="no"])])])
|
||||
|
||||
AS_IF([test "x$with_qt" != "xno"],
|
||||
[AS_IF([test "x$with_qt5" != "xno"],
|
||||
[AC_CHECK_PROGS(MOC, [moc-qt5 moc])
|
||||
AC_MSG_NOTICE([using moc from $MOC])
|
||||
QT_VERSION=`$PKG_CONFIG Qt5Gui --modversion`
|
||||
CPPFLAGS="$CPPFLAGS $QT_CPPFLAGS"
|
||||
dnl -fPIC has no effect on Windows and breaks windres
|
||||
AS_IF([test "x$win32" = "xno"], [CPPFLAGS="$CPPFLAGS -fPIC"])
|
||||
AC_MSG_NOTICE([using Qt version $QT_VERSION])
|
||||
qt_pkgconfig_file="zbar-qt5.pc"
|
||||
],
|
||||
|
||||
[MOC=`$PKG_CONFIG QtGui --variable=moc_location`
|
||||
AC_MSG_NOTICE([using moc from $MOC])
|
||||
QT_VERSION=`$PKG_CONFIG QtGui --modversion`
|
||||
AC_MSG_NOTICE([using Qt version $QT_VERSION])
|
||||
qt_pkgconfig_file="zbar-qt.pc"
|
||||
])])
|
||||
|
||||
AM_CONDITIONAL([HAVE_QT], [test "x$with_qt" = "xyes"])
|
||||
|
||||
AM_COND_IF([HAVE_QT],
|
||||
[AC_CONFIG_FILES([zbar-qt.pc:"${qt_pkgconfig_file}.in"])]
|
||||
)
|
||||
[AC_MSG_NOTICE([using Qt version $QT_VERSION])
|
||||
AC_MSG_NOTICE([using moc from $MOC])
|
||||
CPPFLAGS="$CPPFLAGS $QT_CPPFLAGS"
|
||||
LIBS="$LIBS $QT_LIBS"
|
||||
AC_CONFIG_FILES([zbar-qt.pc:"${qt_pkgconfig_file}.in"])
|
||||
#dnl -fPIC has no effect on Windows and breaks windres
|
||||
AS_IF([test "x$win32" = "xno"], [CPPFLAGS="$CPPFLAGS -fPIC"])])
|
||||
|
||||
dnl Java
|
||||
have_java="maybe"
|
||||
|
||||
@ -34,6 +34,6 @@ WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
|
||||
GENERATE_XML = YES
|
||||
HTML_HEADER =
|
||||
HTML_HEADER =
|
||||
HTML_FOOTER = @top_srcdir@/doc/api/footer.html
|
||||
HTML_STYLESHEET =
|
||||
HTML_STYLESHEET =
|
||||
|
||||
@ -17,6 +17,7 @@
|
||||
<cmdsynopsis>
|
||||
<command>zbarimg</command>
|
||||
<arg><option>-qv</option></arg>
|
||||
<arg><option>--polygon</option></arg>
|
||||
<arg><option>--quiet</option></arg>
|
||||
<arg><option>--verbose<arg>=<replaceable
|
||||
class="parameter">n</replaceable></arg></option></arg>
|
||||
@ -84,6 +85,15 @@
|
||||
<variablelist>
|
||||
&refcommonoptions;
|
||||
|
||||
<varlistentry>
|
||||
<term><option>--polygon</option></term>
|
||||
<listitem>
|
||||
<simpara>Ouput points of the polygon containing the code bar.
|
||||
Using a format compatible with The <polygon> element
|
||||
of the Scalable Vector Graphics (SVG) markup language</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>-q</option></term>
|
||||
<term><option>--quiet</option></term>
|
||||
|
||||
@ -125,7 +125,7 @@ struct _ZBarGtkClass {
|
||||
* @widget: the object that received the signal
|
||||
* @symbol_type: the type of symbol decoded (a zbar_symbol_type_t)
|
||||
* @data: the data decoded from the symbol
|
||||
*
|
||||
*
|
||||
* emitted when a barcode is decoded from an image.
|
||||
* the symbol type and contained data are provided as separate
|
||||
* parameters
|
||||
|
||||
29
perl/Changes
29
perl/Changes
@ -1,5 +1,34 @@
|
||||
Revision history for Perl extension Barcode::ZBar.
|
||||
|
||||
0.10 2022-02-08 Official Release to CPAN
|
||||
* Barcode::ZBar 0.10 update version
|
||||
|
||||
0.09 2022-02-08
|
||||
* bdf1a10 Barcode::ZBar 0.09 update version and Changes
|
||||
* 08ac997 Barcode::ZBar fix test
|
||||
|
||||
0.08 2022-02-07
|
||||
* 0a2fa55 Barcode::ZBar update version for release
|
||||
* 889cc66 perl skip more tests if DISPLAY not set and set prereqs in Makefile.PL
|
||||
* c77594e Barcode::ZBar Update Changes and Increment Version
|
||||
|
||||
0.07 2022-02-06
|
||||
* d0428ef Barcode::ZBar - Image::Magick not installed skip 3 more tests
|
||||
* 576355e Fixes rt.cpan.org 122061 - test fails when DISPLAY not set
|
||||
* e9a0cf2 Update Barcode::ZBar Changes
|
||||
|
||||
0.06 2022-02-06
|
||||
* 93564a5 Add provides and min-perl version to meta files
|
||||
* b01a86f perl module Increment version for cpan release and update changes
|
||||
|
||||
0.05 2022-02-05 - Updates from mchehab/zbar
|
||||
* 0d1d582 perl some packaging improvements
|
||||
* 5b3c33d Enforce a coding style
|
||||
* 2b841d5 Update ZBar's main URL location
|
||||
* d1397ff Fix typos found by codespell.
|
||||
* edcf08b Add support for using versions with major.minor.patch
|
||||
* cd5b63e Update to the very latest version of zbar
|
||||
|
||||
current spadix
|
||||
* add Symbol orientation and Decoder direction interfaces
|
||||
|
||||
|
||||
@ -1,26 +1,26 @@
|
||||
MANIFEST
|
||||
README
|
||||
Changes
|
||||
COPYING.LIB
|
||||
Makefile.PL
|
||||
typemap
|
||||
ZBar.xs
|
||||
ppport.h
|
||||
ZBar.pm
|
||||
ZBar/Image.pod
|
||||
ZBar/ImageScanner.pod
|
||||
ZBar/Processor.pod
|
||||
ZBar/Symbol.pod
|
||||
t/barcode.png
|
||||
t/Decoder.t
|
||||
t/Image.t
|
||||
t/Processor.t
|
||||
t/Scanner.t
|
||||
t/ZBar.t
|
||||
t/pod.t
|
||||
t/pod-coverage.t
|
||||
inc/Devel/CheckLib.pm
|
||||
examples/paginate.pl
|
||||
examples/processor.pl
|
||||
examples/read_one.pl
|
||||
examples/scan_image.pl
|
||||
inc/Devel/CheckLib.pm
|
||||
Makefile.PL
|
||||
MANIFEST This list of files
|
||||
ppport.h
|
||||
README
|
||||
t/barcode.png
|
||||
t/Decoder.t
|
||||
t/Image.t
|
||||
t/pod-coverage.t
|
||||
t/pod.t
|
||||
t/Processor.t
|
||||
t/Scanner.t
|
||||
t/ZBar.t
|
||||
typemap
|
||||
ZBar.pm
|
||||
ZBar.xs
|
||||
ZBar/Image.pod
|
||||
ZBar/ImageScanner.pod
|
||||
ZBar/Processor.pod
|
||||
ZBar/Symbol.pod
|
||||
|
||||
4
perl/MANIFEST.SKIP
Normal file
4
perl/MANIFEST.SKIP
Normal file
@ -0,0 +1,4 @@
|
||||
MANIFEST.bak
|
||||
MANIFEST.SKIP
|
||||
MYMETA.*
|
||||
^Makefile$
|
||||
@ -16,11 +16,49 @@ WriteMakefile(
|
||||
VERSION_FROM => "ZBar.pm",
|
||||
ABSTRACT_FROM => "ZBar.pm",
|
||||
AUTHOR => 'Jeff Brown <spadix@users.sourceforge.net>',
|
||||
LICENSE => 'lgpl',
|
||||
LICENSE => 'lgpl_2_1',
|
||||
LIBS => ['-lzbar'],
|
||||
MIN_PERL_VERSION => '5.006',
|
||||
META_MERGE => {
|
||||
build_requires => {
|
||||
'Test::More' => 0,
|
||||
"meta-spec" => {
|
||||
version => '2',
|
||||
url => 'https://metacpan.org/pod/CPAN::Meta::Spec',
|
||||
},
|
||||
prereqs => {
|
||||
build => {
|
||||
requires => {
|
||||
'Test::More' => 0,
|
||||
},
|
||||
},
|
||||
test => {
|
||||
recommends => {
|
||||
'Image::Magick' => 0,
|
||||
},
|
||||
},
|
||||
develop => {
|
||||
recommends => {
|
||||
'Test::Pod::Coverage' => 0,
|
||||
'Test::Pod' => 0,
|
||||
},
|
||||
}
|
||||
},
|
||||
resources => {
|
||||
homepage => 'https://metacpan.org/pod/Barcode::ZBar/',
|
||||
repository => {
|
||||
type => 'git',
|
||||
url => 'https://github.com/mchehab/zbar.git',
|
||||
web => 'https://github.com/mchehab/zbar',
|
||||
}
|
||||
},
|
||||
provides => {
|
||||
'Barcode::ZBar' => {
|
||||
file => 'ZBar.pm',
|
||||
version => '0.10',
|
||||
},
|
||||
'Barcode::ZBar::Error' => {
|
||||
file => 'ZBar.pm',
|
||||
version => '0.10',
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
@ -32,7 +32,7 @@ our @ISA = qw(Exporter);
|
||||
our @EXPORT_OK = qw(SPACE BAR
|
||||
version increase_verbosity set_verbosity);
|
||||
|
||||
our $VERSION = '0.04';
|
||||
our $VERSION = '0.10';
|
||||
|
||||
require XSLoader;
|
||||
XSLoader::load('Barcode::ZBar', $VERSION);
|
||||
|
||||
@ -108,13 +108,16 @@ Return/specify the raw image data as a binary string.
|
||||
Return a list of scanned Barcode::ZBar::Symbol results attached to
|
||||
this image.
|
||||
|
||||
=item convert_resize(I<format>, I<width>, I<height>)
|
||||
|
||||
=item convert(I<format>)
|
||||
|
||||
Return a new Barcode::ZBar::Image object converted to the indicated
|
||||
fourcc format. Returns C<undef> if the conversion is not supported.
|
||||
Conversion complexity ranges from CPU intensive to trivial depending
|
||||
on the formats involved. Note that only a few conversions retain
|
||||
color information.
|
||||
color information. convert actually calls convert_resize using the
|
||||
source width and height.
|
||||
|
||||
=back
|
||||
|
||||
|
||||
@ -65,6 +65,10 @@ convert from other supported formats to Y800 before scanning.
|
||||
|
||||
Enable the inter-image result consistency cache.
|
||||
|
||||
=item set_config(I<symbology>, I<config>, I<value>)
|
||||
|
||||
Set config for indicated symbology (0 for all) to specified value.
|
||||
|
||||
=item parse_config(I<configstr>)
|
||||
|
||||
Apply a decoder configuration setting. See the documentation for
|
||||
|
||||
@ -121,6 +121,16 @@ Request a preferred size for the video image from the device. The
|
||||
request may be adjusted or completely ignored by the driver. Must be
|
||||
called before C<init()>
|
||||
|
||||
=item force_format(I<input>, I<output>)
|
||||
|
||||
force specific input and output formats for debug/testing.
|
||||
|
||||
=item set_config(I<symbology>, I<config>, I<value>)
|
||||
|
||||
Set config for indicated symbology (0 for all) to specified value.
|
||||
@returns 0 for success, non-0 for failure (config does not apply to
|
||||
specified symbology, or value out of range)
|
||||
|
||||
=back
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
@ -83,6 +83,21 @@ indication of symbol orientation.
|
||||
Components of a composite result. This yields an array of physical
|
||||
component symbols that were combined to form a composite result.
|
||||
|
||||
=item get_configs()
|
||||
|
||||
Retrieve symbology boolean config settings. Returns a bitmask
|
||||
indicating which configs were set for the detected
|
||||
symbology during decoding.
|
||||
|
||||
=item get_modifiers()
|
||||
|
||||
Retrieve symbology modifier flag settings. Returns a bitmask
|
||||
indicating which characteristics were detected during decoding.
|
||||
|
||||
=item get_loc()
|
||||
|
||||
Retrieve an array of symbol location points (x,y)
|
||||
|
||||
=over 2
|
||||
|
||||
=item *
|
||||
|
||||
@ -71,7 +71,7 @@ is_deeply([$image->get_crop()], [0, 0, 114, 80], 'crop reset');
|
||||
# FIXME avoid skipping these (eg embed image vs ImageMagick)
|
||||
SKIP: {
|
||||
eval { require Image::Magick };
|
||||
skip "Image::Magick not installed", 13 if $@;
|
||||
skip "Image::Magick not installed", 16 if $@;
|
||||
|
||||
my $im = Image::Magick->new();
|
||||
my $err = $im->Read('t/barcode.png');
|
||||
|
||||
@ -77,19 +77,23 @@ $proc->set_data_handler(sub {
|
||||
|
||||
#########################
|
||||
|
||||
$proc->init($ENV{VIDEO_DEVICE});
|
||||
ok(!$proc->is_visible(), 'initial visibility');
|
||||
SKIP: {
|
||||
skip "no display", 3 unless defined $ENV{'DISPLAY'};
|
||||
|
||||
#########################
|
||||
$proc->init($ENV{VIDEO_DEVICE});
|
||||
ok(!$proc->is_visible(), 'initial visibility');
|
||||
|
||||
$proc->set_visible();
|
||||
ok($proc->is_visible(), 'enabled visiblity');
|
||||
#########################
|
||||
|
||||
#########################
|
||||
$proc->set_visible();
|
||||
ok($proc->is_visible(), 'enabled visiblity');
|
||||
|
||||
ok($proc->user_wait(1.1) >= 0, 'wait w/timeout');
|
||||
#########################
|
||||
|
||||
#########################
|
||||
ok($proc->user_wait(1.1) >= 0, 'wait w/timeout');
|
||||
|
||||
#########################
|
||||
}
|
||||
|
||||
SKIP: {
|
||||
# FIXME factor out image read utility
|
||||
@ -107,6 +111,9 @@ SKIP: {
|
||||
interlace => 'Plane')
|
||||
);
|
||||
|
||||
SKIP: {
|
||||
skip "no display", 11 unless defined $ENV{'DISPLAY'};
|
||||
|
||||
my $rc = $proc->process_image($image);
|
||||
ok(!$rc, 'process result');
|
||||
|
||||
@ -115,6 +122,7 @@ SKIP: {
|
||||
#########################
|
||||
|
||||
is($explicit_closure, 1, 'handler explicit closure');
|
||||
}
|
||||
}
|
||||
|
||||
#########################
|
||||
|
||||
@ -134,7 +134,7 @@ def run_zbarimg(images):
|
||||
|
||||
# FIXME trim usage from error msg
|
||||
assert rc in (0, 4), \
|
||||
'zbarimg returned error status (%d)\n' % rc + err
|
||||
'zbarimg returned error status (%d):\n\t%s\n' % (rc, err.decode())
|
||||
|
||||
assert not err, err
|
||||
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
prefix=@prefix@
|
||||
exec_prefix=@exec_prefix@
|
||||
libdir=@libdir@
|
||||
includedir=@includedir@
|
||||
|
||||
Name: zbar-qt
|
||||
Description: bar code scanning and decoding Qt4 widget
|
||||
URL: http://zbar.sourceforge.net
|
||||
Version: @VERSION@
|
||||
Requires: zbar, QtCore >= 4, QtGui >= 4
|
||||
Libs: -L${libdir} -lzbarqt
|
||||
Cflags: -I${includedir}
|
||||
@ -349,8 +349,9 @@ enum {
|
||||
TMPL_END,
|
||||
};
|
||||
|
||||
/* FIXME suspect... */
|
||||
#define MAX_STATIC 256
|
||||
/* FIXME should be big enough to store XML extra data */
|
||||
#define MAX_STATIC (1 << 16)
|
||||
|
||||
#define MAX_MOD (5 * ZBAR_MOD_NUM)
|
||||
#define MAX_CFG (10 * ZBAR_CFG_NUM)
|
||||
#define MAX_INT_DIGITS 10
|
||||
@ -377,7 +378,7 @@ char *zbar_symbol_xml(const zbar_symbol_t *sym, char **buf, unsigned *len)
|
||||
{
|
||||
unsigned int mods, cfgs;
|
||||
unsigned int datalen, maxlen;
|
||||
int i, n = 0;
|
||||
int i, n = 0, p;
|
||||
|
||||
const char *type = zbar_get_symbol_name(sym->type);
|
||||
const char *orient = zbar_get_orientation_name(sym->orient);
|
||||
@ -446,7 +447,13 @@ char *zbar_symbol_xml(const zbar_symbol_t *sym, char **buf, unsigned *len)
|
||||
if (sym->cache_count)
|
||||
TMPL_FMT(" count='%d'", sym->cache_count);
|
||||
|
||||
TMPL_COPY("><data");
|
||||
TMPL_COPY("><polygon points='");
|
||||
if (sym->npts > 0 )
|
||||
TMPL_FMT("%+d,%+d", sym->pts[0].x, sym->pts[0].y);
|
||||
for(p = 1; p < sym->npts; p++)
|
||||
TMPL_FMT(" %+d,%+d", sym->pts[p].x, sym->pts[p].y);
|
||||
|
||||
TMPL_COPY("'/><data");
|
||||
if (binary)
|
||||
TMPL_FMT(" format='base64' length='%d'", sym->datalen);
|
||||
TMPL_COPY("><![CDATA[");
|
||||
|
||||
@ -133,6 +133,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
const char *video_arg = NULL;
|
||||
|
||||
gdk_set_allowed_backends("x11,*");
|
||||
gtk_init(&argc, &argv);
|
||||
|
||||
if (argc > 1)
|
||||
|
||||
@ -85,6 +85,7 @@ static const char *note_usage = N_(
|
||||
"options:\n"
|
||||
" -h, --help display this help text\n"
|
||||
" --version display version information and exit\n"
|
||||
" --polygon output points delimiting code zone with decoded symbol data\n"
|
||||
" -q, --quiet minimal output, only print decoded symbol data\n"
|
||||
" -v, --verbose increase debug output level\n"
|
||||
" --verbose=N set specific debug output level\n"
|
||||
@ -130,6 +131,7 @@ static const char *xml_foot = "</barcodes>\n";
|
||||
static int notfound = 0, exit_code = 0;
|
||||
static int num_images = 0, num_symbols = 0;
|
||||
static int xmllvl = 0;
|
||||
static int polygon = 0;
|
||||
static int oneshot = 0;
|
||||
static int binary = 0;
|
||||
|
||||
@ -214,6 +216,14 @@ static int scan_image(const char *filename)
|
||||
else if (xmllvl <= 0) {
|
||||
if (!xmllvl)
|
||||
printf("%s:", zbar_get_symbol_name(typ));
|
||||
if (polygon) {
|
||||
int p;
|
||||
if (zbar_symbol_get_loc_size(sym) > 0)
|
||||
printf("%+d,%+d", zbar_symbol_get_loc_x(sym,0), zbar_symbol_get_loc_y(sym,0));
|
||||
for (p = 1; p < zbar_symbol_get_loc_size(sym); p++)
|
||||
printf(" %+d,%+d", zbar_symbol_get_loc_x(sym,p), zbar_symbol_get_loc_y(sym,p));
|
||||
printf(":");
|
||||
}
|
||||
if (len &&
|
||||
fwrite(zbar_symbol_get_data(sym), len, 1, stdout) != 1) {
|
||||
exit_code = 1;
|
||||
@ -391,6 +401,8 @@ int main(int argc, const char *argv[])
|
||||
} else if (!strcmp(arg, "--raw")) {
|
||||
// RAW mode takes precedence
|
||||
xmllvl = -1;
|
||||
} else if (!strcmp(arg, "--polygon")) {
|
||||
polygon = 1;
|
||||
} else if (!strcmp(arg, "--nodisplay") || !strcmp(arg, "--set") ||
|
||||
!strncmp(arg, "--set=", 6))
|
||||
continue;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user