mirror of
https://github.com/k4yt3x/video2x.git
synced 2025-01-30 15:48:13 +00:00
calculate width/height automatically if the value is 0
This commit is contained in:
parent
227cf54a47
commit
64eb03ac08
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user