-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image component preprocessing problem #8412
Comments
The image does do some processing because we need to get the image into a format that the user can do something with (turn it into a np array, PIL image, or file path with a corresponding file). We need to do this because we don't know if a user wants the image exactly as it is or wants to process it in some way. What is the actual bug here? |
@pngwn From my current requirements for using the gr.Image component, when I want the corresponding file path, I want to get the image path without any processing, which may be helpful for alignment with the results of other programs. But now I have an alternative plan, so I do not have a strong demand for the solution of this problem, just to discuss the possible unreasonable. |
You can set preprocess false on the image to disable any processing and you will get a dictionary including the file path to the original image. |
@pngwn Thank you. This will help me |
Little clarification: you disable preprocessing when defining an event handler, eg.:
You cannot disable preprocessing on |
Describe the bug
I have some doubts about the current Image component, I may be too entangled in the details. When I upload an image on the web page, if my suffix is jpg and Gradio receives an image with the suffix jpeg, and the md5 of the two is different, I guess some pre-processing may be done on the image. But I think the Image component should not make additional changes to the uploaded content, and the Image component should only focus on displaying or passing the content. Is there any additional consideration? I now use gr. File as a substitute
Have you searched existing issues? 🔎
Reproduction
Screenshot
No response
Logs
No response
System Info
Severity
Blocking usage of gradio
The text was updated successfully, but these errors were encountered: