From 7da2e32e3c687f54d8b33154e08b4f453c0d2488 Mon Sep 17 00:00:00 2001 From: Christoph Heuel Date: Thu, 4 Jun 2015 13:20:17 +0200 Subject: [PATCH] Integer is needed, not float * The size of the image can only be integer, not float. Using round to convert it back --- escpos/escpos.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/escpos/escpos.py b/escpos/escpos.py index 3b3a49f..876755e 100644 --- a/escpos/escpos.py +++ b/escpos/escpos.py @@ -29,9 +29,9 @@ class Escpos: else: image_border = 32 - (size % 32) if (image_border % 2) == 0: - return (image_border / 2, image_border / 2) + return (round(image_border / 2), round(image_border / 2)) else: - return (image_border / 2, (image_border / 2) + 1) + return (round(image_border / 2), round((image_border / 2) + 1)) def _print_image(self, line, size):