From 38d98edc4e66cd0805ea0ef2c27fb45b8f681d6d Mon Sep 17 00:00:00 2001 From: Brendan Howell Date: Tue, 16 May 2017 17:07:36 +0200 Subject: [PATCH] hand optimize for extra pixels --- screenless/bureau/photography/photography.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/screenless/bureau/photography/photography.py b/screenless/bureau/photography/photography.py index 1803802..94f2239 100644 --- a/screenless/bureau/photography/photography.py +++ b/screenless/bureau/photography/photography.py @@ -111,8 +111,14 @@ class Photography(Bureau): # crop img = Image.open(tmpimg.name) + img = img.transpose(Image.ROTATE_180) + xsize, ysize = img.size - #TODO: crop here to trim calibrated extra pixels + #crop here to trim calibrated extra pixels + loffset = round(xsize * (float(23) / 257)) + roffset = round(xsize * (float(8) / 257)) + box = (loffset, 0, roffset, ysize) + img = img.crop(box) xsize, ysize = img.size if gpio.input(self.a4_pin) == 0: