From 8a2f6085ed5ff4191954d4dc95ba90f5834e39d1 Mon Sep 17 00:00:00 2001 From: j Date: Mon, 20 Jun 2016 18:33:17 +0200 Subject: [PATCH] self.full_tile_widths[0] can be 0 --- oxtimelines/timeline.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/oxtimelines/timeline.py b/oxtimelines/timeline.py index 6692496..a5204e8 100644 --- a/oxtimelines/timeline.py +++ b/oxtimelines/timeline.py @@ -389,10 +389,11 @@ class Timelines(): self.full_tile_image = Image.new('RGB', (self.full_tile_w, self.large_tile_h)) def _save_full_tile_image(self, mode): - resized = self.large_tile_image[mode].resize(( - self.full_tile_widths[0], self.large_tile_h - ), Image.ANTIALIAS) - self.full_tile_image.paste(resized, (self.full_tile_offset, 0)) + if self.full_tile_widths[0] > 0 and self.large_tile_h > 0: + resized = self.large_tile_image[mode].resize(( + self.full_tile_widths[0], self.large_tile_h + ), Image.ANTIALIAS) + self.full_tile_image.paste(resized, (self.full_tile_offset, 0)) self.full_tile_offset += self.full_tile_widths[0] self.full_tile_widths = self.full_tile_widths[1:]