On my Ubuntu server I've installed the python-qrtools package (which makes use of zbar) using sudo apt-get install python-qrtools
to decode images of QR-codes and bar-codes in Python like this:
>>> qr = qrtools.QR()
>>> qr.decode('the_qrcode_or_barcode_image.jpg')
True
>>> print qr.data
Hello! :)
This works perfectly fine.
I now want to store this data and regenerate the image at a later point in time. But the problem is that I don't know whether the original image was a QR-code or some type of bar-code. I checked all properties of the qr
object, but none of them seems to give me the type of Encoding Style (QR/bar/other).
In this SO thread it is described that ZBar does give back the type of Encoding Style, but it only gives an example in Objective-C, plus I'm not sure if this is actually an answer to what I am looking for.
Does anybody know how I can find out the type of Encoding Style (so QR-code/BAR-code/other) in Python (preferably using the python-qrtools package)? And if not in Python, are there any Linux command line tools which can find this out? All tips are welcome!