mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Use enumerate
This commit is contained in:
parent
2df4865e42
commit
8d5eb71d26
|
@ -168,8 +168,7 @@ def test_mp_no_data():
|
|||
def test_mp_attribute(test_file):
|
||||
with Image.open(test_file) as im:
|
||||
mpinfo = im._getmp()
|
||||
frame_number = 0
|
||||
for mpentry in mpinfo[0xB002]:
|
||||
for frame_number, mpentry in enumerate(mpinfo[0xB002]):
|
||||
mpattr = mpentry["Attribute"]
|
||||
if frame_number:
|
||||
assert not mpattr["RepresentativeImageFlag"]
|
||||
|
@ -180,7 +179,6 @@ def test_mp_attribute(test_file):
|
|||
assert mpattr["ImageDataFormat"] == "JPEG"
|
||||
assert mpattr["MPType"] == "Multi-Frame Image: (Disparity)"
|
||||
assert mpattr["Reserved"] == 0
|
||||
frame_number += 1
|
||||
|
||||
|
||||
@pytest.mark.parametrize("test_file", test_files)
|
||||
|
|
|
@ -238,15 +238,13 @@ def _layerinfo(fp, ct_bytes):
|
|||
layers.append((name, mode, (x0, y0, x1, y1)))
|
||||
|
||||
# get tiles
|
||||
i = 0
|
||||
for name, mode, bbox in layers:
|
||||
for i, (name, mode, bbox) in enumerate(layers):
|
||||
tile = []
|
||||
for m in mode:
|
||||
t = _maketile(fp, m, bbox, 1)
|
||||
if t:
|
||||
tile.extend(t)
|
||||
layers[i] = name, mode, bbox, tile
|
||||
i += 1
|
||||
|
||||
return layers
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user