fork from http://zbar.hg.sourceforge.net/hgweb/zbar/zbar/file/38e78368283d/