mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 09:57:43 +03:00 
			
		
		
		
	Fixed ensuring that previous frame was loaded
This commit is contained in:
		
							parent
							
								
									e2ac1d1c34
								
							
						
					
					
						commit
						d661e438f6
					
				| 
						 | 
					@ -341,6 +341,17 @@ def test_dispose_previous():
 | 
				
			||||||
            pass
 | 
					            pass
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def test_previous_frame_loaded():
 | 
				
			||||||
 | 
					    with Image.open("Tests/images/dispose_none.gif") as img:
 | 
				
			||||||
 | 
					        img.load()
 | 
				
			||||||
 | 
					        img.seek(1)
 | 
				
			||||||
 | 
					        img.load()
 | 
				
			||||||
 | 
					        img.seek(2)
 | 
				
			||||||
 | 
					        with Image.open("Tests/images/dispose_none.gif") as img_skipped:
 | 
				
			||||||
 | 
					            img_skipped.seek(2)
 | 
				
			||||||
 | 
					            assert_image_equal(img_skipped, img)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def test_save_dispose(tmp_path):
 | 
					def test_save_dispose(tmp_path):
 | 
				
			||||||
    out = str(tmp_path / "temp.gif")
 | 
					    out = str(tmp_path / "temp.gif")
 | 
				
			||||||
    im_list = [
 | 
					    im_list = [
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -148,7 +148,7 @@ class GifImageFile(ImageFile.ImageFile):
 | 
				
			||||||
            self.disposal_method = 0
 | 
					            self.disposal_method = 0
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            # ensure that the previous frame was loaded
 | 
					            # ensure that the previous frame was loaded
 | 
				
			||||||
            if not self.im:
 | 
					            if self.tile:
 | 
				
			||||||
                self.load()
 | 
					                self.load()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if frame != self.__frame + 1:
 | 
					        if frame != self.__frame + 1:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user