mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 09:14:27 +03:00
only update the disposal_method if it not 'unspecified'
This commit is contained in:
parent
f88a355c6c
commit
047832c6c6
|
@ -144,8 +144,14 @@ class GifImageFile(ImageFile.ImageFile):
|
|||
self.info["duration"] = i16(block[1:3]) * 10
|
||||
|
||||
# disposal method - find the value of bits 4 - 6
|
||||
self.disposal_method = 0b00011100 & flags
|
||||
self.disposal_method = self.disposal_method >> 2
|
||||
dispose_bits = 0b00011100 & flags
|
||||
dispose_bits = dispose_bits >> 2
|
||||
if dispose_bits:
|
||||
# only set the dispose if it is not
|
||||
# unspecified. I'm not sure if this is
|
||||
# correct, but it seems to prevent the last
|
||||
# frame from looking odd for some animations
|
||||
self.disposal_method = dispose_bits
|
||||
elif i8(s) == 255:
|
||||
#
|
||||
# application extension
|
||||
|
|
Loading…
Reference in New Issue
Block a user