Spaces:
Sleeping
Sleeping
| 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() |