fileName = QtGui.QFileDialog.getOpenFileName(self, self.tr("Open File"),
QtCore.QDir.currentPath())
pil_img = self.setImage(str(fileName))
def setImage(self, filename):
"set image to given filename"
self.filename = filename
self.pilImg = None
if not (filename and os.path.exists(filename)):
return
try:
pilImg = Image.open(filename)
except IOError:
self.writeStatus("Error loading image")
return
return pilImg
Sunday, February 7, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment