##// END OF EJS Templates
Use gif format
Grant Nestor -
Show More
@@ -1079,8 +1079,7 b' class Image(DisplayObject):'
1079 if ext == u'png':
1079 if ext == u'png':
1080 format = self._FMT_PNG
1080 format = self._FMT_PNG
1081 if ext == u'gif':
1081 if ext == u'gif':
1082 # use PNG format until we understand why GIF is not working
1082 format = self._FMT_GIF
1083 format = self._FMT_PNG
1084 else:
1083 else:
1085 format = ext.lower()
1084 format = ext.lower()
1086 elif isinstance(data, bytes):
1085 elif isinstance(data, bytes):
@@ -1097,10 +1096,6 b' class Image(DisplayObject):'
1097 # jpg->jpeg
1096 # jpg->jpeg
1098 format = self._FMT_JPEG
1097 format = self._FMT_JPEG
1099
1098
1100 if format == self._FMT_GIF:
1101 # use PNG format until we understand why GIF is not working
1102 format = self._FMT_PNG
1103
1104 self.format = format.lower()
1099 self.format = format.lower()
1105 self.embed = embed if embed is not None else (url is None)
1100 self.embed = embed if embed is not None else (url is None)
1106
1101
@@ -1130,6 +1125,8 b' class Image(DisplayObject):'
1130 w, h = _pngxy(self.data)
1125 w, h = _pngxy(self.data)
1131 elif self.format == self._FMT_JPEG:
1126 elif self.format == self._FMT_JPEG:
1132 w, h = _jpegxy(self.data)
1127 w, h = _jpegxy(self.data)
1128 elif self.format == self._FMT_GIF:
1129 w, h = _pngxy(self.data)
1133 else:
1130 else:
1134 # retina only supports png
1131 # retina only supports png
1135 return
1132 return
@@ -1184,7 +1181,7 b' class Image(DisplayObject):'
1184 return self._data_and_metadata()
1181 return self._data_and_metadata()
1185
1182
1186 def _repr_gif_(self):
1183 def _repr_gif_(self):
1187 if self.embed and self.format == self._FMT_PNG:
1184 if self.embed and self.format == self._FMT_GIF:
1188 return self._data_and_metadata()
1185 return self._data_and_metadata()
1189
1186
1190 def _find_ext(self, s):
1187 def _find_ext(self, s):
General Comments 0
You need to be logged in to leave comments. Login now