diff options
author | Asbjørn Sloth Tønnesen <asbjorn@asbjorn.biz> | 2012-04-22 11:31:22 +0000 |
---|---|---|
committer | Asbjørn Sloth Tønnesen <asbjorn@asbjorn.biz> | 2012-04-22 11:31:22 +0000 |
commit | 1e0caaba5fcef66e65da449b76828436b52ffb02 (patch) | |
tree | 44050508b9433fcffa843e8ea463cf87c9e39eb4 /python | |
parent | 0807696fb46ef5f890967f91d9dcd0c9c6efeab3 (diff) | |
download | ql570-1e0caaba5fcef66e65da449b76828436b52ffb02.tar.gz ql570-1e0caaba5fcef66e65da449b76828436b52ffb02.tar.xz ql570-1e0caaba5fcef66e65da449b76828436b52ffb02.zip |
fix landscape
Diffstat (limited to 'python')
-rw-r--r-- | python/label.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/python/label.py b/python/label.py index 41618bb..c154275 100644 --- a/python/label.py +++ b/python/label.py @@ -3,12 +3,12 @@ from PIL import Image, ImageFont, ImageDraw class label: def __init__(self, length, width=336, landscape=False): assert(width == 336 or width == 720) - self.landscape = False + self.landscape = landscape self.fontfile = '/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf' self.im = Image.new("1", (width, length), "white") if self.landscape: - self.im.rotate(90) + self.im = self.im.rotate(90) def set_font(self, fontfile): self.fontfile = fontfile @@ -21,6 +21,6 @@ class label: draw.text(pos, text, font=self.font) def save(self, outfile): - if self.landscape: - self.im.rotate(90) + if not self.landscape: + self.im = self.im.rotate(90) self.im.save(outfile, "PNG") |