Skip to content

Instantly share code, notes, and snippets.

@matthiasg
Last active August 29, 2015 14:07
Show Gist options
  • Save matthiasg/4a8788c39052c75e63f5 to your computer and use it in GitHub Desktop.
Save matthiasg/4a8788c39052c75e63f5 to your computer and use it in GitHub Desktop.
Compile zbar on SmartOS (works against JPEG! but not PNGs)

Tested:

SmartOS BaseImage: 20150219T102159Z Zone Image: b451ca78-1ca5-11e4-8a4c-5f463f94e8f1 (elasticsearch 14.2.0 smartos 2014-08-05T13:37:54Z)

Source:

Download zbar source from: http://zbar.sourceforge.net/download.html => zbar-0.10.tar.bz2 Download imagemagick source from: http://www.imagemagick.org/download/ImageMagick.tar.gz => ``

Extract:

bzip2 -d zbar-0.10.tar.bz2
tar -xf zbar-0.10.tar
tar -xzf ImageMagick.tar.gz

Install required packages:

pkgin in pkg-config

Configure,Compile and install ImageMagick

cd ImageMagick-6.9.1-2
./configure --prefix=/opt/local/ImageMagick --enable-shared=yes --with-quantum-depth=8

make install

Configure

MAGICK_CFLAGS="" MAGICK_LIBS="-L/opt/local/lib -L/opt/local/ImageMagick/lib -lMagickWand-6.Q8" ./configure --disable-video --without-qt --without-gtk --without-python

Compile

make

Result

zbarimg should now be in subfolder zbarimg

PS: Sadly it does not work against PNG files yet. When i convert them to JPEG (using imagemagick's convert) they work fine though :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment