import Image from PIL, or Pillow

This commit is contained in:
freeyoung 2014-03-14 01:51:14 +08:00
parent 442e523956
commit b68b3dc6c0
1 changed files with 6 additions and 6 deletions

View File

@ -6,11 +6,11 @@
@license: GPL
'''
import Image
import qrcode
import time
import os
import operator
from PIL import Image
from constants import *
from exceptions import *
@ -37,7 +37,7 @@ class Escpos:
i = 0
cont = 0
buffer = ""
self._raw(S_RASTER_N)
buffer = "%02X%02X%02X%02X" % (((size[0]/size[1])/8), 0, size[1], 0)
self._raw(buffer.decode('hex'))
@ -135,7 +135,7 @@ class Escpos:
break
elif im_color > (255 * 3 / pattern_len * pattern_len) and im_color <= (255 * 3):
pix_line += im_pattern[-1]
break
break
pix_line += im_right
img_size[0] += im_border[1]
@ -177,9 +177,9 @@ class Escpos:
self._raw(BARCODE_TXT_BTH)
elif pos.upper() == "ABOVE":
self._raw(BARCODE_TXT_ABV)
else: # DEFAULT POSITION: BELOW
else: # DEFAULT POSITION: BELOW
self._raw(BARCODE_TXT_BLW)
# Type
# Type
if bc.upper() == "UPC-A":
self._raw(BARCODE_UPC_A)
elif bc.upper() == "UPC-E":
@ -202,7 +202,7 @@ class Escpos:
else:
raise exception.BarcodeCodeError()
def text(self, txt):
""" Print alpha-numeric text """
if txt: