Initialize the image size. Note that this is done with the default/current Context, as there may not be a view availabe yet.
(self)
| 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.""" |