mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-07 13:25:24 +03:00
Linting changes
This commit is contained in:
parent
53cfd19a44
commit
85a07bb385
|
@ -329,7 +329,6 @@ class TestFileGif(PillowTestCase):
|
||||||
d = ImageDraw.Draw(img)
|
d = ImageDraw.Draw(img)
|
||||||
d.ellipse([(40, 40), (60, 60)], fill='#f00')
|
d.ellipse([(40, 40), (60, 60)], fill='#f00')
|
||||||
|
|
||||||
# check per frame disposal
|
|
||||||
im_list[0].save(
|
im_list[0].save(
|
||||||
out,
|
out,
|
||||||
save_all=True,
|
save_all=True,
|
||||||
|
@ -341,13 +340,6 @@ class TestFileGif(PillowTestCase):
|
||||||
top_left_pixels = []
|
top_left_pixels = []
|
||||||
center_pixels = []
|
center_pixels = []
|
||||||
|
|
||||||
# # Get pixel in top left
|
|
||||||
# rgb_img = img.convert('RGB')
|
|
||||||
# r, g, b = rgb_img.getpixel((1,1))
|
|
||||||
# top_left_pixels += [(r,g,b)]
|
|
||||||
# r, g, b = rgb_img.getpixel((50,50))
|
|
||||||
# center_pixels += [(r,g,b)]
|
|
||||||
|
|
||||||
for i in range(3):
|
for i in range(3):
|
||||||
rgb_img = img.convert('RGB')
|
rgb_img = img.convert('RGB')
|
||||||
# Get pixel in top left
|
# Get pixel in top left
|
||||||
|
|
|
@ -476,7 +476,7 @@ def _write_multiple_frames(im, fp, palette):
|
||||||
if len(im_frames) > 1:
|
if len(im_frames) > 1:
|
||||||
for frame_data in im_frames:
|
for frame_data in im_frames:
|
||||||
im_frame = frame_data['im']
|
im_frame = frame_data['im']
|
||||||
if("disposal" in frame_data["encoderinfo"] \
|
if("disposal" in frame_data["encoderinfo"]
|
||||||
and frame_data["encoderinfo"]["disposal"] == 2):
|
and frame_data["encoderinfo"]["disposal"] == 2):
|
||||||
frame_data['encoderinfo']['include_color_table'] = True
|
frame_data['encoderinfo']['include_color_table'] = True
|
||||||
if not frame_data['bbox']:
|
if not frame_data['bbox']:
|
||||||
|
@ -589,7 +589,8 @@ def _write_local_header(fp, im, offset, flags):
|
||||||
if include_color_table:
|
if include_color_table:
|
||||||
palette_bytes = _get_palette_bytes(im)
|
palette_bytes = _get_palette_bytes(im)
|
||||||
# If needed, expand palette to minimum size
|
# If needed, expand palette to minimum size
|
||||||
while(len(palette_bytes)<9): palette_bytes = palette_bytes*2
|
while(len(palette_bytes) < 9):
|
||||||
|
palette_bytes = palette_bytes*2
|
||||||
color_table_size = _get_color_table_size(palette_bytes)
|
color_table_size = _get_color_table_size(palette_bytes)
|
||||||
if color_table_size:
|
if color_table_size:
|
||||||
flags = flags | 128 # local color table flag
|
flags = flags | 128 # local color table flag
|
||||||
|
|
Loading…
Reference in New Issue
Block a user