def height(self): if not self.config.has_key("height"): if issif_as_image(self.path): return self._get_image().size[1] else: raise TypeError, "config should has 'height' property." else: return int(self.config["height"])
def width(self): if not self.config.has_key("width"): if issif_as_image(self.path): return self._get_image().size[0] else: raise TypeError, "config should has 'width' property." else: return int(self.config["width"])
def _load(self): if issif_as_image(self.path): return self._load_as_image() else: return self._load_not_image()
def _get_image(self): if issif_as_image(self.path): return Image.open(self.path) else: return self._create_canvas()