Commit Graph

33 Commits

Author SHA1 Message Date
ssrlive
f0b3ab2324 find . -regex '.*\.\(cpp\|hpp\|cu\|c\|h\)' -exec clang-format --verbose --style=file -i {} \; 2021-10-07 09:19:48 +00:00
ssrlive
cf3d385492 Synchronize with upstream code. 2021-10-07 16:38:06 +08:00
ssrlive
a812a96fad clang-format find . -regex '.*\.\(cpp\|hpp\|cu\|c\|h\)' -exec clang-format --verbose --style=file -i {} \; 2021-10-07 06:06:52 +00:00
ssrlive
8a030167e4 following upstream changes. 2021-08-15 12:14:00 +08:00
wqh17101
a8218439bd Update setup.py
fix install error
2021-01-09 10:32:53 +01:00
Mauro Carvalho Chehab
923da762e8 python: get rid of a Python 3.9 warning
As mentioned on:
	https://cpython-ericholscher.readthedocs.io/en/sphinx-hoverxref/whatsnew/3.9.html

The PyEval_InitThreads() and PyEval_ThreadsInitialized() functions are now
deprecated and will be removed in Python 3.11. Calling PyEval_InitThreads()
now does nothing. The GIL is initialized by Py_Initialize() since Python 3.7.

So, let's not call it on Python 3.9, in order to avoid a
warning noise.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-12-23 11:56:08 +01:00
Mauro Carvalho Chehab
938d397164 python: enum: make it compatible with Python 3.9
As reported by:
	https://github.com/mchehab/zbar/issues/92

python bindings don't build with Python 3.9, because it is
using tp_print, which has been silently ignored since Python
3.0, according with[1]:

	"The tp_print slot of PyTypeObject has been removed.
	 It was used for printing objects to files in Python 2.7
	 and before.
	 Since Python 3.0, it has been ignored and unused."

[1] https://docs.python.org/3.9/whatsnew/3.9.html#id3

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-07-28 10:31:37 +02:00
Matheus Afonso Martins Moreira
488bac3f9b config: add boolean option for raw binary decoding
When decoders encounter binary data, they attempt to guess the encoding
of the data and convert it to text. This destroys other types of data.

The new boolean decoder configuration option ZBAR_CFG_BINARY
suppresses this automatic character set conversion.
The decoders that support it will output the raw binary data.

Signed-off-by: Matheus Afonso Martins Moreira <matheus.a.m.moreira@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-03-13 10:49:04 +01:00
Mauro Carvalho Chehab
2b841d5497 Update ZBar's main URL location
As we're maintaining ZBar now mainly at github, update its
location along some places.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-13 19:12:00 -03:00
Mauro Carvalho Chehab
fab5eaa49d python: suppress an unnoying warning
As described at:
	http://python3porting.com/cextensions.html

PyObject should be replaced by PyVarObject on python3. This
is backward-compatible with python 2.6 and python 2.7. So,
it should work fine for all practical purposes.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-12 07:31:24 -03:00
Mauro Carvalho Chehab
34bc4bcd93 python: return decoded symbols as Unicode
As python3 default type is unicode, we should return unicode
to it, as otherwise symbols won't be properly displayed.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-10 17:47:31 -03:00
Mauro Carvalho Chehab
77dfb98a18 python/image.c: fix unicode handling
On python 3, everything is converted internally to utf-8.
So, in order to have the same API to work with both python2
and python3, we need to teach python C API bindings to handle
unicode too.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-10 17:32:53 -03:00
Mauro Carvalho Chehab
77338f8354 python/Makefile.am.inc: Only export the initialization symbol
The python3 port uses a different symbol for the zbar initialization
code. re-add the -export-symbol-regex with was removed from libtool,
ensuring that only either initzbar (Python2) or PyInit_zbar (Python3)
will be exported.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-05-06 05:31:57 -03:00
Jonas Jelten
aad7446c2d python setup.py version update 2019-05-05 19:14:00 +02:00
Jonas Jelten
aea5c3c551 don't limit exported symbols to python module init function 2019-05-05 19:14:00 +02:00
Jonas Jelten
0e98994fb2 deglobalize all state in python 2019-05-05 19:13:59 +02:00
Jonas Jelten
8b2a1c245a port to python3 2019-05-05 19:13:59 +02:00
Javier Serrano Polo
0583b85093 Apply jasp-01-sqcode.patch
Add support for SQ code, a simple 2D barcode. zbarimg works with images
without noise elements. Language bindings have not been tested.

Signed-off-by: Javier Serrano Polo <javier@jasp.net>
2019-02-02 18:07:15 +01:00
Mauro Carvalho Chehab
edcf08b49e Add support for using versions with major.minor.patch
If patch is not specified, it will default to zero.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-08-08 10:11:02 -03:00
Mauro Carvalho Chehab
d24312964e Be sure to use python 2
The zbar python binding is written for python 2. I doesn't build
with python 3. While nobody works on such conversion, better to
let it clearer.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-08-08 07:25:27 -03:00
Mauro Carvalho Chehab
c06e7e1940 python: Make it work with modern versions of python 2
Some of the examples and test code don't work with python 2.7
and PIL. Modernize them by running 2to3 and fixing PIL manually.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-08-07 16:12:54 -03:00
Mauro Carvalho Chehab
378fb7db32 Fix a bug at python/imagescanner.c
This patch came from Debian ZBar repository:
	https://sources.debian.net/data/main/z/zbar/0.10+doc-10.1/debian/patches/python-zbar-import-fix-am.patch

Apparently, it was reported on this bug:
	https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=702499

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-04-11 12:00:22 -03:00
Mauro Carvalho Chehab
cd5b63e5b5 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.

[Imported from Fedora 26 tree]
2017-03-25 23:04:38 -03:00
spadix@users.sourceforge.net
4fce4655e9 add result query interfaces to image scanner and processor
- move result filtering into image scanner (from user)
    - abort output blockers when window closed
2009-10-21 10:34:43 -04:00
spadix@users.sourceforge.net
86f8aa606e cleanup warnings from newer gccs 2009-10-15 17:11:33 -04:00
spadix@users.sourceforge.net
47b8945076 extract explicit result container, separate from image
- remove (broken/tmp) converted image result sharing
    - add explicit symbol recycle API, update processor/widgets to use
    - cleanup and update C++ API
    - update Python/Perl APIs
    - fix broken and add new Python/Perl tests

--HG--
branch : qr
2009-09-24 11:35:22 -04:00
spadix@users.sourceforge.net
232fc0df7d add symbol quality metric and image scanner position config
- update python, perl and docs
2009-08-28 14:26:29 -04:00
spadix@users.sourceforge.net
402fe8b038 compatibility fixes
- work around ImageMagick API breakages
    - fix some OS X compile issues
2009-08-28 09:35:56 -04:00
spadix@users.sourceforge.net
e8b97bf352 more testing, fixes and cleanup
- fix v4l1
    - fix/add null processor interface
2009-08-18 19:23:26 -04:00
spadix@users.sf.net
d584d44b58 fix symbol leaks
- add symbol reference counting
2009-08-03 15:02:04 -04:00
spadix@users.sf.net
a331c22379 add support for binary symbol data 2009-07-30 18:21:43 -04:00
spadix@users.sf.net
8c5c489309 * fixup some perl distribution details
* project name change: everything "zebra" becomes "zbar"
  * remove old logo
2009-04-17 22:26:38 +00:00
spadix@users.sf.net
155aaa265a * add first pass python bindings!
* fix perl mortality bug
  * add new cfg constants to perl
  * fix perl doc handler ref
  * fix processor set_active error propagation
  * add wiki examples (scan_image.*, processor.*)
2009-03-26 01:21:48 +00:00