Skip to content

Instantly share code, notes, and snippets.

@maxkarelov
Created May 25, 2017 13:41
Show Gist options
  • Save maxkarelov/58ecbfe0d9d31bf581dc3db7cf2e6911 to your computer and use it in GitHub Desktop.
Save maxkarelov/58ecbfe0d9d31bf581dc3db7cf2e6911 to your computer and use it in GitHub Desktop.
decode qr code from photo sample script
from PIL import Image
import zbarlight
file_path = '/Users/ivankumar/Downloads/sample3.jpg'
with open(file_path, 'rb') as image_file:
image = Image.open(image_file)
image.load()
codes = zbarlight.scan_codes('qrcode', image)
print('QR codes: %s' % codes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment