diff --git a/pandora/archive/extract.py b/pandora/archive/extract.py index a5a64525..19c76372 100644 --- a/pandora/archive/extract.py +++ b/pandora/archive/extract.py @@ -241,7 +241,7 @@ def frame(videoFile, frame, position, height=128, redo=False): videoFile input frame output position as float in seconds - width of frame + height of frame redo boolean to extract file even if it exists ''' if exists(videoFile): diff --git a/pandora/item/models.py b/pandora/item/models.py index 939e3aa8..74ee69d8 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -850,7 +850,7 @@ class Item(models.Model): ''' Video related functions ''' - def frame(self, position, height=128): + def frame(self, position, height=None): offset = 0 streams = self.streams() for stream in streams: @@ -858,7 +858,10 @@ class Item(models.Model): offset += stream.duration else: position = position - offset - height = min(height, stream.resolution) + if not height: + height = stream.resolution + else: + height = min(height, stream.resolution) path = os.path.join(settings.MEDIA_ROOT, stream.path(), 'frames', "%dp"%height, "%s.jpg"%position) if not os.path.exists(path) and stream.video: