mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 01:47:47 +03:00 
			
		
		
		
	Check encoder info for disposal mode
This commit is contained in:
		
							parent
							
								
									8a36a15ebd
								
							
						
					
					
						commit
						53cfd19a44
					
				| 
						 | 
					@ -444,8 +444,8 @@ def _write_multiple_frames(im, fp, palette):
 | 
				
			||||||
            if im_frames:
 | 
					            if im_frames:
 | 
				
			||||||
                # delta frame
 | 
					                # delta frame
 | 
				
			||||||
                previous = im_frames[-1]
 | 
					                previous = im_frames[-1]
 | 
				
			||||||
                if "disposal" in im.encoderinfo \
 | 
					                if "disposal" in encoderinfo \
 | 
				
			||||||
                   and im.encoderinfo["disposal"] == 2:
 | 
					                   and encoderinfo["disposal"] == 2:
 | 
				
			||||||
                    base_image = background
 | 
					                    base_image = background
 | 
				
			||||||
                else:
 | 
					                else:
 | 
				
			||||||
                    base_image = previous["im"]
 | 
					                    base_image = previous["im"]
 | 
				
			||||||
| 
						 | 
					@ -457,8 +457,8 @@ def _write_multiple_frames(im, fp, palette):
 | 
				
			||||||
                    delta = ImageChops.subtract_modulo(
 | 
					                    delta = ImageChops.subtract_modulo(
 | 
				
			||||||
                        im_frame.convert('RGB'), base_image.convert('RGB'))
 | 
					                        im_frame.convert('RGB'), base_image.convert('RGB'))
 | 
				
			||||||
                bbox = delta.getbbox()
 | 
					                bbox = delta.getbbox()
 | 
				
			||||||
                if not bbox and not ("disposal" in im.encoderinfo
 | 
					                if not bbox and not ("disposal" in encoderinfo
 | 
				
			||||||
                   and im.encoderinfo["disposal"] == 2):
 | 
					                   and encoderinfo["disposal"] == 2):
 | 
				
			||||||
                    # This frame is identical to the previous frame
 | 
					                    # This frame is identical to the previous frame
 | 
				
			||||||
                    if duration:
 | 
					                    if duration:
 | 
				
			||||||
                        previous['encoderinfo']['duration'] += \
 | 
					                        previous['encoderinfo']['duration'] += \
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user