Name: zbar-python-patched
Owner: Natural History Museum
Description: Python wrapper for ZBar bar code library, patched for OS X, and with a wheel for 32-bit Python on Windows
Created: 2016-01-14 07:56:07.0
Updated: 2016-09-27 22:21:54.0
Pushed: 2016-01-14 19:47:25.0
Size: 39
Language: C
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
ZBar 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 many popular symbologies (types of bar codes) including EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 39, Interleaved 2 of 5 and QR Code.
This repository is forked from the ZBar python wrapper download at PyPI, and only contains the python wrapper for the C library. For the full C library source, installation directions, etc., check out the ZBar homepage.
The Natural History Museum's fork adds a wheel build for Windows 32-bit.
Patches imagescanner.c
to fix crashing (segmentation fault 11) issues with import zbar
on OS X.
Patch taken from http://launchpadlibrarian.net/134768014/zbar_0.10+doc-7build3_0.10+doc-8.diff.gz.
Install zbar
using homebrew:
install zbar
Install the extension module
install https://github.com/NaturalHistoryMuseum/zbar-python-patched/archive/v0.10.tar.gz
Install a release from this repo, e.g.:
install https://github.com/NaturalHistoryMuseum/zbar-python-patched/releases/download/v0.10/zbar-0.10-cp27-none-win_win32.whl
You should only need to build if you want to release a new version.
Download and install Miniconda-latest-Windows-x86.exe.
Download
MinGW,
install to C:\MinGW
, and run
inGW\bin\mingw-get.exe install gcc
Create libpython27.a
from python27.dll
, for the benefit of the MinGW linker
Following this advice.
inGW\bin\mingw-get install pexports
/F %a IN ('python -c "import sys; print(sys.exec_prefix)"') DO cd %a
inGW\bin\pexports.exe python27.dll > python27.def
inGW\bin\dlltool --dllname python27.dll --def python27.def --output-lib libs\libpython27.a
Download
zbar-0.10-setup.exe
and install to c:\zbar
Build the zbar
Python extension module and a wheel
where you cloned this repo>
PATH=c:\MinGW\bin;%PATH%
INCLUDE=C:\ZBar\include;%INCLUDE%
LIB=C:\ZBar\lib;%LIB%
LIBPATH=C:\ZBar\lib;%LIBPATH%
PATH=c:\MinGW\bin;%PATH%
d.bat
The dist
directory will contain a wheel.