diff --git a/papirus/epd.pyc b/papirus/epd.pyc deleted file mode 100644 index cbe22de..0000000 Binary files a/papirus/epd.pyc and /dev/null differ diff --git a/papirus/image.py b/papirus/image.py index 9535316..5c03b1f 100644 --- a/papirus/image.py +++ b/papirus/image.py @@ -16,11 +16,13 @@ def write(self, image): # crop to the middle w,h = image.size - x = w / 2 - epd.width / 2 - y = h / 2 - epd.height / 2 + x = w / 2 - self.papirus.width / 2 + y = h / 2 - self.papirus.height / 2 - rs = image.resize((epd.width, epd.height)) + rs = image + if w != self.papirus.width or h != self.papirus.height: + rs = image.resize((self.papirus.width, self.papirus.height)) bw = rs.convert("1", dither=Image.FLOYDSTEINBERG) - epd.display(bw) - epd.update() + self.papirus.display(bw) + self.papirus.update()