def extract_message(): global filename try: newFile, file_name = LSBv2.extract(filename) fileName = tkFileDialog.asksaveasfile(parent=master, initialfile=file_name, title="Save the image as...", mode='w') if fileName != None: LSBv2.save_file(fileName.name, newFile) except: dialog_box("Invalid file selected") return print file_name
def onOpen(): global filename # Open Callback ftypes = [('Image Files', '*.tif *.jpg *.png')] dlg = tkFileDialog.Open(filetypes=ftypes) filename = dlg.show() if filename != None: print filename img = Image.open(filename) setImage(img, 1) lsb = setQuality() LSBv2.open_image(filename, lsb) onSpinboxChanged()
def onOpen(): global filename # Open Callback ftypes = [('Image Files', '*.tif *.jpg *.png')] dlg = tkFileDialog.Open(filetypes=ftypes) filename = dlg.show() if filename != None: print filename img = Image.open(filename) setImage(img,1) lsb = setQuality() LSBv2.open_image(filename,lsb) onSpinboxChanged()
def onSpinboxChanged(event = None): global e1 e1.delete(0,END) quality_value = sb.get() lsb = setQuality() try: e1.insert(0,"Available size = " + str(LSBv2.get_image_theoretical_max_available_size(lsb)/1024.0) + " KBytes") except: pass
def onSpinboxChanged(event=None): global e1 e1.delete(0, END) quality_value = sb.get() lsb = setQuality() try: e1.insert( 0, "Available size = " + str(LSBv2.get_image_theoretical_max_available_size(lsb) / 1024.0) + " KBytes") except: pass
def hide_procedure(): if filename == "": dialog_box("Please choose a file") return lsb = setQuality() try: hide_img = LSBv2.hide_file(filename, int(lsb)) except ValueError as e: dialog_box(e) return dialog_box("DONE") setImage(hide_img, 2)
def hide_procedure(): if filename == "": dialog_box("Please choose a file") return lsb = setQuality() try: hide_img = LSBv2.hide_file(filename, int(lsb)) except ValueError as e: dialog_box(e) return dialog_box("DONE") setImage(hide_img,2)