Skip to content

Commit 204e93d

Browse files
committed
GH-59: Fix the case the video is too short
1 parent eb1469c commit 204e93d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/thumbnails/video.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ def calc_columns(self):
7979
for col in range(1, self.frames_count):
8080
if (col * width) / (self.frames_count // col * height) > ratio:
8181
return col
82+
return 1 # fixes the case when the video is too short
8283

8384
def _extract_frame(self, start_time):
8485
"""Extracts a single frame from the video by the offset."""

0 commit comments

Comments
 (0)