Browse Source

fix save_qrcode

283
ThomasV 12 years ago
parent
commit
c51efc0afe
  1. 11
      lib/bmp.py

11
lib/bmp.py

@ -194,14 +194,13 @@ class BitMap(object):
def save_qrcode(qr, filename): def save_qrcode(qr, filename):
bitmap = BitMap( 35*8, 35*8 ) k = qr.moduleCount
#print len(bitmap.bitarray) bitmap = BitMap( (k+2)*8, (k+2)*8 )
bitmap.bitarray = [] bitmap.bitarray = []
k = 33 for r in range(k+2):
for r in range(35): tmparray = [ 0 ] * (k+2)*8
tmparray = [ 0 ] * 35*8
if 0 < r < 34: if 0 < r < k+1:
for c in range(k): for c in range(k):
if qr.isDark(r-1, c): if qr.isDark(r-1, c):
tmparray[ (1+c)*8:(2+c)*8] = [1]*8 tmparray[ (1+c)*8:(2+c)*8] = [1]*8

Loading…
Cancel
Save