gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
34.13k stars 2.6k forks source link

Issue with gr.ImageEditor in Gradio Application #8556

Open rybakov-ks opened 5 months ago

rybakov-ks commented 5 months ago

Describe the bug

We have encountered an issue with the 'gr.ImageEditor' component in a Gradio application. The problem occurs when the application is accessed via a mobile browser and a photo taken with the phone's camera (4032x3024, 1.9 MB, iPhone 12) is uploaded. Upon attempting to upload this image, the page automatically reloads, disrupting the user experience. However, smaller images (e.g., 1170x3532, 109 KB) upload without problems.

Have you searched existing issues? 🔎

Reproduction

import gradio as gr

demo = gr.Blocks() 

with demo:
    image_input = gr.ImageEditor()

demo.launch()

Screenshot

No response

Logs

No response

System Info

Gradio Environment Information:
------------------------------
Operating System: Linux
gradio version: 4.36.1
gradio_client version: 1.0.1

------------------------------------------------
gradio dependencies in your environment:

aiofiles: 22.1.0
altair: 5.0.1
fastapi: 0.100.1
ffmpy: 0.3.1
gradio-client==1.0.1 is not installed.
httpx: 0.24.1
huggingface-hub: 0.22.2
importlib-resources: 6.4.0
jinja2: 3.1.2
markupsafe: 2.1.3
matplotlib: 3.7.2
numpy: 1.26.2
orjson: 3.9.2
packaging: 23.1
pandas: 1.5.3
pillow: 8.4.0
pydantic: 2.6.1
pydub: 0.25.1
python-multipart: 0.0.9
pyyaml: 6.0.1
ruff: 0.4.1
semantic-version: 2.10.0
tomlkit==0.12.0 is not installed.
typer: 0.12.3
typing-extensions: 4.7.1
urllib3: 2.2.1
uvicorn: 0.23.2
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.

gradio_client dependencies in your environment:

fsspec: 2023.6.0
httpx: 0.24.1
huggingface-hub: 0.22.2
packaging: 23.1
typing-extensions: 4.7.1
websockets: 11.0.3

Severity

I can work around it

abidlabs commented 1 month ago

Hi, apologies for the late follow up. We haven't had a chance to look into this issue yet, but the Gradio codebase has changed quite significantly since this issue was created, particularly with the release of Gradio 5. Could you let us know if this is still an issue in the latest version of Gradio (pip install --upgrade gradio)? Thanks!

rybakov-ks commented 1 month ago

Hello,

I am encountering the same issue with the gr.ImageEditor component in Gradio version 5.1.0. It no longer works on PC, while it was functioning correctly in the previous version.

I have attached a video demonstrating how it worked in both the old and new versions.

https://github.com/user-attachments/assets/5eb8b47e-63e0-49c9-b321-817beeee9080

https://github.com/user-attachments/assets/232f984f-5cf2-4ae4-9ac9-18a8060909e1