Esempio n. 1
0
 def from_file(self, filename, translate=False):
     """Load graphic from an image file."""
     if filename[-4:].lower() == '.lmp':
         self.data = util.readfile(filename)
     else:
         im = Image.open(filename)
         self.from_Image(im, translate)
Esempio n. 2
0
 def from_file(self, filename, translate=False):
     """Load graphic from an image file."""
     if filename[-4:].lower() == '.lmp':
         self.data = util.readfile(filename)
     else:
         im = Image.open(filename)
         self.from_Image(im, translate)
Esempio n. 3
0
 def from_file(self, source):
     """Load data from a file. Source may be a path name string
     or a file-like object (with a `write` method)."""
     self.data = util.readfile(source)
Esempio n. 4
0
 def from_file(self, source):
     """Load data from a file. Source may be a path name string
     or a file-like object (with a `write` method)."""
     self.data = util.readfile(source)