From 64eb03ac08bdc41c47588a4e0ab1cd3a385a8d73 Mon Sep 17 00:00:00 2001 From: K4YT3X Date: Thu, 10 Sep 2020 16:38:11 -0400 Subject: [PATCH] calculate width/height automatically if the value is 0 --- src/upscaler.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/upscaler.py b/src/upscaler.py index 4ef8175..29613bf 100755 --- a/src/upscaler.py +++ b/src/upscaler.py @@ -591,10 +591,10 @@ class Upscaler: if self.scale_width is not None or self.scale_height is not None: # scale keeping aspect ratio is only one of width/height is given - if self.scale_width is None: + if self.scale_width == 0 or self.scale_width is None: self.scale_width = self.scale_height / height * width - elif self.scale_height is None: + elif self.scale_height == 0 or self.scale_height is None: self.scale_height = self.scale_width / width * height self.scale_ratio = 2