mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-10 19:56:47 +03:00
Draw first frame on top of transparency
This commit is contained in:
parent
70ef50cf72
commit
5b4cb5052a
BIN
Tests/images/first_frame_transparency.gif
Normal file
BIN
Tests/images/first_frame_transparency.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 972 B |
|
@ -298,6 +298,12 @@ def test_eoferror():
|
|||
im.seek(n_frames - 1)
|
||||
|
||||
|
||||
def test_first_frame_transparency():
|
||||
with Image.open("Tests/images/first_frame_transparency.gif") as im:
|
||||
px = im.load()
|
||||
assert px[0, 0] == im.info["transparency"]
|
||||
|
||||
|
||||
def test_dispose_none():
|
||||
with Image.open("Tests/images/dispose_none.gif") as img:
|
||||
try:
|
||||
|
|
|
@ -317,6 +317,12 @@ class GifImageFile(ImageFile.ImageFile):
|
|||
if self.palette:
|
||||
self.mode = "P"
|
||||
|
||||
def load_prepare(self):
|
||||
if not self.im and "transparency" in self.info:
|
||||
self.im = Image.core.fill(self.mode, self.size, self.info["transparency"])
|
||||
|
||||
super(GifImageFile, self).load_prepare()
|
||||
|
||||
def tell(self):
|
||||
return self.__frame
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user