1

I am using zbar python module for integrating Barcode reader but unable to open a view for that my code:

#!/usr/bin/python
from sys import argv
import zbar
from PIL import Image
import io
import time
import picamera

class BarCodeScan(BrowserView):
   def __call__(self):
    if len(argv) < 2: exit(1)

    # create a reader
    scanner = zbar.ImageScanner()

    # configure the reader
    scanner.parse_config('enable')

    # obtain image data
    pil = Image.open(argv[1]).convert('L')
    width, height = pil.size
    raw = pil.tostring()

    # wrap image data
    image = zbar.Image(width, height, 'Y800', raw)

    # scan the image for barcodes
    scanner.scan(image)

    # extract results
    for symbol in image:
        # do something useful with results
        print 'decoded', symbol.type, 'symbol', '"%s"' % symbol.data

    # clean up
    del(image)

It gives following error:

OSError: libmmal.so: cannot open shared object file: No such file or directory

snipersnack
  • 133
  • 1
  • 1
  • 9
  • 3
    Are you certain that libmmal is installed? Is it possible that you have not installed the picamera library? [This](http://stackoverflow.com/questions/27777547/missing-libmmal-so-with-picamera-library) is another SO question that might be related, and [here](https://www.google.com/search?q=libmmal&oq=libmmal) are a set of google results related to libmmal.so being missing on raspberry pi. I suspect this is not a Plone problem, but something with the installation of picamera on your machine. – cewing Nov 06 '15 at 19:31

0 Answers0