avoid negative pixels

This commit is contained in:
j 2023-07-06 16:22:23 +05:30
parent 92d5c6e763
commit f5becafad4

View file

@ -151,8 +151,10 @@ class File(models.Model):
self.sampleate = 0 self.sampleate = 0
self.channels = 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) self.pixels = int(self.width * self.height * float(utils.parse_decimal(self.framerate)) * self.duration)
else:
self.pixels = 0
def get_path_info(self): def get_path_info(self):
data = {} data = {}