def getQR(imgargrgb):
 imgarg = imgargrgb.convert('L')
 scanner = zbar.ImageScanner()
 scanner.parse_config('enable')
 (width, height) = imgarg.size
 raw = imgarg.tostring()
 image = zbar.Image(width, height, 'Y800', raw)
 scanner.scan(image)
 for symbol in image:
  print 'decoded', symbol.type, 'symbol', ('"%s"' % symbol.data)
  return symbol.data
 del image

def getQR ( imgargrgb ) : imgarg = imgargrgb . convert ( 'L' ) scanner = zbar . ImageScanner ( ) scanner . parse_config ( 'enable' ) ( width , height ) = imgarg . size raw = imgarg . tostring ( ) image = zbar . Image ( width , height , 'Y800' , raw ) scanner . scan ( image ) for symbol in image : print 'decoded' , symbol . type , 'symbol' , ( '"%s"' % symbol . data ) return symbol . data del image
read qr code from image .