def _ImageOps__saveFileAsCallback(self, arguments): #print "saveFileAs(", arguments, ")" if(self.im != 0): try: name = arguments print "Saving frame as %s." % name saveasType = movietools.getTypeFromExtension(name) self.im.save(name, saveasType) except IOError: print "Could not save the image!" else: print "Can't save image because no image was loaded."
def _ImageOps__saveFileAsCallback(self, arguments): #print "saveFileAs(", arguments, ")" if(self.im != 0): try: name = arguments print("Saving frame as %s." % name) saveasType = movietools.getTypeFromExtension(name) self.im.save(name, saveasType) except IOError: print("Could not save the image!") else: print("Can't save image because no image was loaded.")
def process(self, baseFormat, startIndex): self.baseFormat = baseFormat self.fileIndex = startIndex self.saveType = movietools.getTypeFromExtension(baseFormat) for instruction in self.imageops: # Get the function name and arguments. functionName = instruction[0] arguments = instruction[1:][0] try: # Lookup the function using the function name. function = self.operations[functionName] function(arguments) except TypeError: print "ImageOpsBase.process(): Failed to execute: ", functionName, "(", arguments, ")" except KeyError: print "ImageOpsBase.process(): \"%s\" is an invalid instruction." % functionName return self.fileIndex
def process(self, baseFormat, startIndex): self.baseFormat = baseFormat self.fileIndex = startIndex self.saveType = movietools.getTypeFromExtension(baseFormat) for instruction in self.imageops: # Get the function name and arguments. functionName = instruction[0] arguments = instruction[1:][0] try: # Lookup the function using the function name. function = self.operations[functionName] function(arguments) except TypeError: print("ImageOpsBase.process(): Failed to execute: ", functionName, "(", arguments, ")") except KeyError: print("ImageOpsBase.process(): \"%s\" is an invalid instruction." % functionName) return self.fileIndex