Fix mipmap calculation

This commit is contained in:
REDxEYE 2022-08-13 23:43:44 +03:00
parent 7285b74a61
commit afc0e8e1a0

View File

@ -178,10 +178,9 @@ def _get_mipmap_count(width: int, height: int):
while True: while True:
mip_width = width >> mip_count mip_width = width >> mip_count
mip_height = height >> mip_count mip_height = height >> mip_count
if mip_width < 1 or mip_height < 1: if mip_width == 0 and mip_height == 0:
break
mip_count += 1
return mip_count return mip_count
mip_count += 1
def _write_image(fp: BufferedIOBase, im: Image.Image, pixel_format: VtfPF): def _write_image(fp: BufferedIOBase, im: Image.Image, pixel_format: VtfPF):