mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 01:47:47 +03:00 
			
		
		
		
	_crop already makes a copy of the image
This commit is contained in:
		
							parent
							
								
									f91f93e246
								
							
						
					
					
						commit
						16dbffc3a8
					
				| 
						 | 
					@ -267,14 +267,15 @@ class GifImageFile(ImageFile.ImageFile):
 | 
				
			||||||
                # replace with background colour
 | 
					                # replace with background colour
 | 
				
			||||||
                Image._decompression_bomb_check(self.size)
 | 
					                Image._decompression_bomb_check(self.size)
 | 
				
			||||||
                self.dispose = Image.core.fill("P", self.size, self.info["background"])
 | 
					                self.dispose = Image.core.fill("P", self.size, self.info["background"])
 | 
				
			||||||
            else:
 | 
					 | 
				
			||||||
                # replace with previous contents
 | 
					 | 
				
			||||||
                if self.im:
 | 
					 | 
				
			||||||
                    self.dispose = self.im.copy()
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                # only dispose the extent in this frame
 | 
					                # only dispose the extent in this frame
 | 
				
			||||||
                if self.dispose:
 | 
					                if self.dispose:
 | 
				
			||||||
                    self.dispose = self._crop(self.dispose, self.dispose_extent)
 | 
					                    self.dispose = self._crop(self.dispose, self.dispose_extent)
 | 
				
			||||||
 | 
					            else:
 | 
				
			||||||
 | 
					                # replace with previous contents
 | 
				
			||||||
 | 
					                if self.im:
 | 
				
			||||||
 | 
					                    # only dispose the extent in this frame
 | 
				
			||||||
 | 
					                    self.dispose = self._crop(self.im, self.dispose_extent)
 | 
				
			||||||
        except (AttributeError, KeyError):
 | 
					        except (AttributeError, KeyError):
 | 
				
			||||||
            pass
 | 
					            pass
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user