mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 17:24:31 +03:00
Replace with transparency if available for disposal method 2
This commit is contained in:
parent
f6d504c8f6
commit
e29a7d8a94
|
@ -269,9 +269,14 @@ class GifImageFile(ImageFile.ImageFile):
|
|||
dispose_size = (x1 - x0, y1 - y0)
|
||||
|
||||
Image._decompression_bomb_check(dispose_size)
|
||||
self.dispose = Image.core.fill(
|
||||
"P", dispose_size, self.info.get("background", 0)
|
||||
|
||||
# by convention, attempt to use transparency first
|
||||
color = (
|
||||
frame_transparency
|
||||
if frame_transparency is not None
|
||||
else self.info.get("background", 0)
|
||||
)
|
||||
self.dispose = Image.core.fill("P", dispose_size, color)
|
||||
else:
|
||||
# replace with previous contents
|
||||
if self.im:
|
||||
|
|
Loading…
Reference in New Issue
Block a user