From b6c253464442cd9b9203f0f0c4eb736a7d97e7af Mon Sep 17 00:00:00 2001 From: Ace Date: Fri, 9 Oct 2020 11:25:11 +0200 Subject: [PATCH] fix for 9.7" epaper display This commit should fix any previous issues with the 9.7" epaper displays not showing the image correctly --- inkycal/display/epaper.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/inkycal/display/epaper.py b/inkycal/display/epaper.py index bec2b1f..4e4eb7c 100644 --- a/inkycal/display/epaper.py +++ b/inkycal/display/epaper.py @@ -23,6 +23,7 @@ class Display: driver_path = 'inkycal.display.drivers.{}'.format(epaper_model) driver = import_module(driver_path) self._epaper = driver.EPD() + self.model_name = epaper_model except ImportError: raise Exception('This module is not supported. Check your spellings?') @@ -39,6 +40,10 @@ class Display: if self.supports_colour == False: print('Initialising..', end = '') epaper.init() + # For the 9.7" ePaper, the image needs to be flipped by 90 deg first + # The other displays flip the image automatically + if self.model_name == "9_in_7": + im_black.rotate(90, expand=True) print('Updating display......', end = '') epaper.display(epaper.getbuffer(im_black)) print('Done')