From d74d49cc903b88f1053d6ad5f145f4de7b0c7ad8 Mon Sep 17 00:00:00 2001 From: benoitguigal Date: Tue, 19 May 2015 15:31:58 +0200 Subject: [PATCH] rotate image before printing it --- Dockerfile | 9 +++++---- figureraspbian/devices/printer.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2cdab4f..f348a68 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,10 +39,11 @@ RUN wget --no-check-certificate https://github.com/aeberhardo/phantomjs-linux-ar bunzip2 *.bz2 && \ tar xf *.tar -RUN wget --no-check-certificate https://github.com/benoitguigal/python-epson-printer/archive/v1.7.zip && \ - unzip v1.7.zip && \ - rm v1.7.zip && \ - cd python-epson-printer-1.7 && \ +RUN echo 'disable cache' +RUN wget --no-check-certificate https://github.com/benoitguigal/python-epson-printer/archive/v1.7.1.zip && \ + unzip v1.7.1.zip && \ + rm v1.7.1.zip && \ + cd python-epson-printer-1.7.1 && \ python setup.py install RUN pip install gphoto2==1.1.0 \ diff --git a/figureraspbian/devices/printer.py b/figureraspbian/devices/printer.py index 15faeaf..56fd7fa 100644 --- a/figureraspbian/devices/printer.py +++ b/figureraspbian/devices/printer.py @@ -49,7 +49,7 @@ def __init__(self): self.printer.set_print_speed(2) def print_ticket(self, ticket_data): - self.printer.print_image_from_buffer(ticket_data) + self.printer.print_image_from_buffer(ticket_data, rotate=True) self.printer.linefeed(4) self.printer.cut()