def prepare(args): if checkPIL(): quality = 95 if len(args) == 4: quality = int(args[3]) from pilconv import PilConv print PilConv.convert(args[0], args[1], args[2], quality)
def _confirm(self): if not self._check_file_save(0): return if not self._check_file_open(1): return jpt = self.entries[0].get() custom = self.entries[1].get() quality = 95 try: quality = int(self.entries[2].get()) except: self.entries[2].delete(0, END) self.entries[2].insert(0, "95") jpeg = custom + "__tmp__.jpg" png = custom + "__tmp__.png" PilConv.convert(custom, jpeg, png, quality) result = Jpt.merge(jpt, jpeg, png) os.remove(jpeg) os.remove(png) tkMessageBox.showinfo(self.title, result)