From 2ad9961d59aad812e551a6746c423c83cd9a948b Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 16 May 2012 15:25:11 +0200 Subject: [PATCH] dont fail if cut_width is 0, fixme: it should never be 0 in the first place --- oxtimelines/timeline.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/oxtimelines/timeline.py b/oxtimelines/timeline.py index 30cbf25..9624a06 100644 --- a/oxtimelines/timeline.py +++ b/oxtimelines/timeline.py @@ -436,6 +436,8 @@ class Timelines(): wide = 1 if mode == 'keyframes' else self.wide frame_ratio = self.frame_ratio * wide cut_images = int(math.ceil(cut_width / (frame_ratio * self.large_tile_h))) + if cut_width == cut_images == 0: + print 'ERROR division by zerro', cut_width, cut_images image_widths = self._divide(cut_width, cut_images) image_i = self.cuts[-2] large_keyframes_tile_i = self.large_keyframes_tile_i @@ -506,6 +508,8 @@ class Timelines(): def _divide(self, num, by): # divide(100, 3) -> [33, 33, 34] arr = [] + if by == 0: + return arr div = int(num / by) mod = num % by for i in range(int(by)):