diff --git a/PIL/TiffImagePlugin.py b/PIL/TiffImagePlugin.py index 1b60e8016..b9dd19a61 100644 --- a/PIL/TiffImagePlugin.py +++ b/PIL/TiffImagePlugin.py @@ -1784,14 +1784,14 @@ class AppendingTiffWriter: def _save_all(im, fp, filename): encoderinfo = im.encoderinfo.copy() encoderconfig = im.encoderconfig - append_images = encoderinfo.get("append_images", []) + append_images = list(encoderinfo.get("append_images", [])) if not hasattr(im, "n_frames") and not append_images: return _save(im, fp, filename) cur_idx = im.tell() try: with AppendingTiffWriter(fp) as tf: - for ims in itertools.chain([im], append_images): + for ims in [im]+append_images: ims.encoderinfo = encoderinfo ims.encoderconfig = encoderconfig if not hasattr(ims, "n_frames"):