apply the smallest scaling ratio available instead of 1

This commit is contained in:
K4YT3X 2020-10-26 21:53:03 +00:00 committed by GitHub
parent c2f1e43656
commit 84b0684d64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -625,9 +625,10 @@ class Upscaler:
remaining_scaling_ratio = math.ceil(output_scale) remaining_scaling_ratio = math.ceil(output_scale)
self.scaling_jobs = [] self.scaling_jobs = []
# special case for 1.0 upscale ratio # if the scaling ratio is 1.0
# apply the smallest scaling ratio available
if remaining_scaling_ratio == 1: if remaining_scaling_ratio == 1:
self.scaling_jobs.append(1) self.scaling_jobs.append(supported_scaling_ratios[0])
else: else:
while remaining_scaling_ratio > 1: while remaining_scaling_ratio > 1:
for ratio in supported_scaling_ratios: for ratio in supported_scaling_ratios:
@ -637,7 +638,6 @@ class Upscaler:
break break
else: else:
found = False found = False
for i in supported_scaling_ratios: for i in supported_scaling_ratios:
for j in supported_scaling_ratios: for j in supported_scaling_ratios: