Open mdornseif opened 13 years ago
I have the same problem with:
from huBarcode.qrcode import QRCodeEncoder
qr_encoder = QRCodeEncoder(id.zfill(12)) return HttpResponse(content=qr_encoder.get_imagedata(cellsize = 5), mimetype="image/png")
for example with id = 832
Does anybody have a patch for this?
Don't have a patch... but a workaround...thats works...:
from huBarcode.qrcode import QRCodeEncoder
qr_encoder = None
try:
qr_encoder = QRCodeEncoder(id, "M")
except IndexError:
try:
qr_encoder = QRCodeEncoder(id, "L")
except IndexError:
try:
qr_encoder = QRCodeEncoder(id, "H")
except IndexError:
qr_encoder = QRCodeEncoder(id, "Q")
return HttpResponse(content=qr_encoder.get_imagedata(cellsize = 5), mimetype="image/png")
I encountered this today on the 1.0.0 tar.gz from pypi, and fixed it locally - was going to submit a PR, but it looks to have been fixed in commit 205bb1d1f4c588a28c25b5a3e7454bcc41468430 ... is there any chance 1.0.1 call be pushed up to the cheeseshop?
+1 for pushing 1.0.1
hongshan liu writes:
hi,Maximillian Dornseif, I was using your huBarcode,but I found some bugs when I using it.
bug example1:
-- coding: utf-8 --
bug info: File "/home/works/hudora-huBarcode-7a9d83e/hubarcode/qrcode/textencoder.py", line 207, in create_matrix matrix_content = self.minfo.create_matrix(self.version, self.codewords) File "/home/works/hudora-huBarcode-7a9d83e/hubarcode/qrcode/isodata.py", line 109, in create_matrix codeword_i = codewords[i] IndexError: list index out of range
could you fix these? thank you!