File size: 506 Bytes
68387e1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from PIL import Image
import gradio as gr


def get_png_info(image):
    return image.info

with gr.Blocks() as demo:
    gr.Markdown(
    '''
    # 📚 Read Png Info
    Read meta data of Image
    '''
    )
    with gr.Row():
        with gr.Column():
            image = gr.Image(interactive=True, type="pil")
            btn_submit = gr.Button()
        info_dict = gr.JSON()
    
    btn_submit.click(
        fn=get_png_info,
        inputs=[image],
        outputs=[info_dict],
    )

demo.launch()