def encode(info, img, tx, key): try: image = Image.open(img) contents = encode_file(tx, img) contents = contents + "*//*" + info encriptador = Encryptor() contents = encriptador.run(key, contents) st = stepic.encode(image, contents) name = img.split(".png")[0] + ".png" st.save(name, "png") except Exception as e: print(e)