Skip to content

Commit 9e0da0c

Browse files
committed
GH-59: Fix the cannot identify image file ... issue
The issue was occurring because `arange` was going out of range because of the `duration + 1` operation on the metadata parsing step
1 parent 204e93d commit 9e0da0c

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/thumbnails/ffmpeg.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ class _FFMpeg:
1212
"""This class is used to parse the metadata of a video file."""
1313

1414
def __init__(self, filepath):
15-
duration, self.size = self._parse_metadata(filepath)
16-
self.duration = int(duration + 1)
15+
self.duration, self.size = self._parse_metadata(filepath)
1716

1817
@staticmethod
1918
def _parse_duration(stdout):

src/thumbnails/video.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def arange(start, stop, step):
2020

2121
def _generator():
2222
nonlocal start
23-
while start < stop:
23+
while start <= stop:
2424
yield start
2525
start += step
2626

0 commit comments

Comments
 (0)