MCPcopy Create free account
hub / github.com/PageBot/PageBot / initImageSize

Method initImageSize

Lib/pagebot/elements/image.py:272–281  ·  view source on GitHub ↗

Initialize the image size. Note that this is done with the default/current Context, as there may not be a view availabe yet.

(self)

Source from the content-addressed store, hash-verified

270 path = property(_get_path, _set_path)
271
272 def initImageSize(self):
273 """Initialize the image size. Note that this is done with the
274 default/current Context, as there may not be a view availabe yet."""
275 # Default, in case Undefined or non-existing, there is no image file.
276 iw = ih = pt(0)
277 if self.path is not None and os.path.exists(self.path):
278 imageSize = self.context.imageSize(self.path)
279 if imageSize is not None:
280 iw, ih = imageSize
281 self.iw, self.ih = iw, ih
282
283 def _get_imageSize(self):
284 """Answers the Point2D image size in pixels."""

Callers 1

setPathMethod · 0.95

Calls 2

ptFunction · 0.90
imageSizeMethod · 0.45

Tested by

no test coverage detected