MCPcopy
hub / github.com/tonquer/JMComic-qt / GetAnimationFormat

Method GetAnimationFormat

src/tools/tool.py:159–173  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

157
158 @staticmethod
159 def GetAnimationFormat(data):
160 try:
161 from PIL import Image
162 from io import BytesIO
163 a = BytesIO(data)
164 img = Image.open(a)
165
166 format = ""
167 if getattr(img, "is_animated", ""):
168 format = img.format
169 a.close()
170 return format
171 except Exception as es:
172 Log.Error(es)
173 return ""
174
175 @staticmethod
176 def GetPictureSize(data):

Callers 2

SetGifDataMethod · 0.80
SetGifDataMethod · 0.80

Calls 2

ErrorMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected