From f5becafad4a8ac90a56931c1419759af2b5ccdd9 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 6 Jul 2023 16:22:23 +0530 Subject: [PATCH] avoid negative pixels --- pandora/archive/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora/archive/models.py b/pandora/archive/models.py index 5c847144..31be9dba 100644 --- a/pandora/archive/models.py +++ b/pandora/archive/models.py @@ -151,8 +151,10 @@ class File(models.Model): self.sampleate = 0 self.channels = 0 - if self.framerate: + if self.framerate and self.duration > 0: self.pixels = int(self.width * self.height * float(utils.parse_decimal(self.framerate)) * self.duration) + else: + self.pixels = 0 def get_path_info(self): data = {}