This commit is contained in:
chflame163
2024-01-28 19:07:16 +08:00
committed by GitHub
parent 80ce3d2401
commit 785bff9ddf
+4 -2
View File
@@ -153,10 +153,12 @@ def __rotate_expand(image:Image, angle:float, SSAA:int=0, method:str="lanczos")
img_us_scaled = img.resize((width * SSAA, height * SSAA), resize_sampler)
img_rotated = img_us_scaled.rotate(angle, rotate_sampler, expand == "true", fillcolor=(0, 0, 0, 0))
img_down_scaled = img_rotated.resize((img_rotated.width // SSAA, img_rotated.height // SSAA), resize_sampler)
result = img_down_scaled.image_to_tensor()
# result = img_down_scaled.image_to_tensor()
result = pil2tensor(img_down_scaled)
else:
img_rotated = img.rotate(angle, rotate_sampler, expand == "true", fillcolor=(0, 0, 0, 0))
result = img_rotated.image_to_tensor()
# result = img_rotated.image_to_tensor()
result = pil2tensor(img_rotated)
return result
if angle == 0.0 or angle == 360.0: