Exemple #1
0
 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"])
Exemple #2
0
 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"])
Exemple #3
0
 def _load(self):
     if issif_as_image(self.path):
         return self._load_as_image()
     else:
         return self._load_not_image()
Exemple #4
0
 def _get_image(self):
     if issif_as_image(self.path):
         return Image.open(self.path)
     else:
         return self._create_canvas()