mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-23 15:20:33 +03:00
Fix mipmap calculation
This commit is contained in:
parent
7285b74a61
commit
afc0e8e1a0
|
@ -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):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user