From 7c70032fe71acd4da77bcd9b0d4532a852540966 Mon Sep 17 00:00:00 2001 From: k4yt3x Date: Wed, 20 Sep 2023 05:43:45 +0000 Subject: [PATCH] fix(video2x): fixed the issue where output width/height aren't calculated if they are None Signed-off-by: k4yt3x --- video2x/video2x.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/video2x/video2x.py b/video2x/video2x.py index 802094b..2b62496 100755 --- a/video2x/video2x.py +++ b/video2x/video2x.py @@ -394,10 +394,10 @@ class Video2X: width, height, total_frames, frame_rate = self._get_video_info(input_path) # automatically calculate output width and height if only one is given - if output_width == 0: + if output_width == 0 or output_width is None: output_width = output_height / height * width - elif output_height == 0: + elif output_height == 0 or output_width is None: output_height = output_width / width * height # sanitize output width and height to be divisible by 2