Use rgba data for opaque animations that uses blended frames

This commit is contained in:
Kovid Goyal 2021-02-04 14:39:06 +05:30
parent 2650c7dd9e
commit 3925e18964
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -140,7 +140,12 @@ def identify(path: str) -> ImageData:
data = json.loads(b'[' + p.stdout.rstrip(b',') + b']')
first = data[0]
frames = list(map(Frame, data))
return ImageData(first['fmt'].lower(), frames[0].width, frames[0].height, frames[0].mode, frames)
mode = 'rgb'
for f in frames:
if f.mode == 'rgba':
mode = 'rgba'
break
return ImageData(first['fmt'].lower(), frames[0].width, frames[0].height, mode, frames)
class RenderedImage(ImageData):