diff --git a/PIL/GifImagePlugin.py b/PIL/GifImagePlugin.py index 68c623395..e55460f2c 100644 --- a/PIL/GifImagePlugin.py +++ b/PIL/GifImagePlugin.py @@ -714,7 +714,7 @@ def _write_frame_data(fp, im_frame, offset, params): # -------------------------------------------------------------------- # Legacy GIF utilities -def getheader(im, palette=None, info=[]): +def getheader(im, palette=None, info=None): """ Legacy Method to get Gif data from image. @@ -728,6 +728,9 @@ def getheader(im, palette=None, info=[]): """ used_palette_colors = _get_optimize(im, info) + if info is None: + info = {} + if not "background" in info and "background" in im.info: info["background"] = im.info["background"]