Linting changes

This commit is contained in:
Riley Lahd 2019-03-14 14:51:13 -06:00
parent 53cfd19a44
commit 85a07bb385
2 changed files with 11 additions and 18 deletions

View File

@ -329,7 +329,6 @@ class TestFileGif(PillowTestCase):
d = ImageDraw.Draw(img)
d.ellipse([(40, 40), (60, 60)], fill='#f00')
# check per frame disposal
im_list[0].save(
out,
save_all=True,
@ -341,13 +340,6 @@ class TestFileGif(PillowTestCase):
top_left_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):
rgb_img = img.convert('RGB')
# Get pixel in top left

View File

@ -476,7 +476,7 @@ def _write_multiple_frames(im, fp, palette):
if len(im_frames) > 1:
for frame_data in im_frames:
im_frame = frame_data['im']
if("disposal" in frame_data["encoderinfo"] \
if("disposal" in frame_data["encoderinfo"]
and frame_data["encoderinfo"]["disposal"] == 2):
frame_data['encoderinfo']['include_color_table'] = True
if not frame_data['bbox']:
@ -589,7 +589,8 @@ def _write_local_header(fp, im, offset, flags):
if include_color_table:
palette_bytes = _get_palette_bytes(im)
# 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)
if color_table_size:
flags = flags | 128 # local color table flag