@@ -296,16 +296,18 @@ def test_save_all() -> None:
296
296
assert_image_similar (im , im_reloaded , 30 )
297
297
298
298
im = Image .new ("RGB" , (1 , 1 ))
299
- im2 = Image .new ("RGB" , (1 , 1 ), "#f00" )
300
- im_reloaded = roundtrip (im , save_all = True , append_images = [im2 ])
301
-
302
- assert_image_equal (im , im_reloaded )
303
- assert isinstance (im_reloaded , MpoImagePlugin .MpoImageFile )
304
- assert im_reloaded .mpinfo is not None
305
- assert im_reloaded .mpinfo [45056 ] == b"0100"
306
-
307
- im_reloaded .seek (1 )
308
- assert_image_similar (im2 , im_reloaded , 1 )
299
+ for colors in (("#f00" ,), ("#f00" , "#0f0" )):
300
+ append_images = [Image .new ("RGB" , (1 , 1 ), color ) for color in colors ]
301
+ im_reloaded = roundtrip (im , save_all = True , append_images = append_images )
302
+
303
+ assert_image_equal (im , im_reloaded )
304
+ assert isinstance (im_reloaded , MpoImagePlugin .MpoImageFile )
305
+ assert im_reloaded .mpinfo is not None
306
+ assert im_reloaded .mpinfo [45056 ] == b"0100"
307
+
308
+ for im_expected in append_images :
309
+ im_reloaded .seek (im_reloaded .tell () + 1 )
310
+ assert_image_similar (im_reloaded , im_expected , 1 )
309
311
310
312
# Test that a single frame image will not be saved as an MPO
311
313
jpg = roundtrip (im , save_all = True )
0 commit comments