Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -49,12 +49,12 @@ def decode_image(img, key):
|
|
| 49 |
return "", gr.update(visible=True, value=f"Error: {str(e)}")
|
| 50 |
|
| 51 |
with gr.Blocks() as demo:
|
| 52 |
-
gr.Markdown("
|
| 53 |
-
with gr.Tab("ENC
|
| 54 |
with gr.Row():
|
| 55 |
with gr.Column():
|
| 56 |
image_enc = gr.Image(label="Upload Image", type="pil")
|
| 57 |
-
input_text = gr.Textbox(label="Input text", lines=5, placeholder="Enter
|
| 58 |
with gr.Row():
|
| 59 |
key_enc = gr.Textbox(label="Key", max_lines=1, placeholder="Enter key or generate one")
|
| 60 |
gen_key_btn = gr.Button("🔑 Generate random key")
|
|
@@ -62,11 +62,11 @@ with gr.Blocks() as demo:
|
|
| 62 |
download_link = gr.File(label="Download image with encrypted message", visible=False)
|
| 63 |
enc_status = gr.Textbox(label="Status", interactive=False, visible=True)
|
| 64 |
|
| 65 |
-
with gr.Tab("DEC
|
| 66 |
with gr.Row():
|
| 67 |
with gr.Column():
|
| 68 |
-
image_dec = gr.Image(label="Upload Image
|
| 69 |
-
key_dec = gr.Textbox(label="Key", max_lines=1, placeholder="Enter key
|
| 70 |
dec_btn = gr.Button("Decrypt")
|
| 71 |
output_text = gr.Textbox(label="Decrypted Message", lines=5, interactive=False)
|
| 72 |
dec_status = gr.Textbox(label="Status", interactive=False, visible=True)
|
|
|
|
| 49 |
return "", gr.update(visible=True, value=f"Error: {str(e)}")
|
| 50 |
|
| 51 |
with gr.Blocks() as demo:
|
| 52 |
+
gr.Markdown("Image Toolkit v1")
|
| 53 |
+
with gr.Tab("ENC"):
|
| 54 |
with gr.Row():
|
| 55 |
with gr.Column():
|
| 56 |
image_enc = gr.Image(label="Upload Image", type="pil")
|
| 57 |
+
input_text = gr.Textbox(label="Input text", lines=5, placeholder="Enter text here")
|
| 58 |
with gr.Row():
|
| 59 |
key_enc = gr.Textbox(label="Key", max_lines=1, placeholder="Enter key or generate one")
|
| 60 |
gen_key_btn = gr.Button("🔑 Generate random key")
|
|
|
|
| 62 |
download_link = gr.File(label="Download image with encrypted message", visible=False)
|
| 63 |
enc_status = gr.Textbox(label="Status", interactive=False, visible=True)
|
| 64 |
|
| 65 |
+
with gr.Tab("DEC"):
|
| 66 |
with gr.Row():
|
| 67 |
with gr.Column():
|
| 68 |
+
image_dec = gr.Image(label="Upload Image", type="filepath")
|
| 69 |
+
key_dec = gr.Textbox(label="Key", max_lines=1, placeholder="Enter key")
|
| 70 |
dec_btn = gr.Button("Decrypt")
|
| 71 |
output_text = gr.Textbox(label="Decrypted Message", lines=5, interactive=False)
|
| 72 |
dec_status = gr.Textbox(label="Status", interactive=False, visible=True)
|