MCPcopy Index your code
hub / github.com/ipython/ipython / _retina_shape

Method _retina_shape

IPython/core/display.py:1040–1054  ·  view source on GitHub ↗

load pixel-doubled width and height from image data

(self)

Source from the content-addressed store, hash-verified

1038
1039
1040 def _retina_shape(self):
1041 """load pixel-doubled width and height from image data"""
1042 if not self.embed:
1043 return
1044 if self.format == self._FMT_PNG:
1045 w, h = _pngxy(self.data)
1046 elif self.format == self._FMT_JPEG:
1047 w, h = _jpegxy(self.data)
1048 elif self.format == self._FMT_GIF:
1049 w, h = _gifxy(self.data)
1050 else:
1051 # retina only supports png
1052 return
1053 self.width = w // 2
1054 self.height = h // 2
1055
1056 def reload(self):
1057 """Reload the raw data from file or URL."""

Callers 2

__init__Method · 0.95
reloadMethod · 0.95

Calls 3

_pngxyFunction · 0.85
_jpegxyFunction · 0.85
_gifxyFunction · 0.85

Tested by

no test coverage detected