LibreChat
LibreChat copied to clipboard
Enhancement: Resize images on upload
What features would you like to see added?
Resize uploaded pictures to meet server size requirements
More details
When submitting an image in the chat window, large images produce a vague "an error occurred while uploading the file" error. I suggest resizing in the browser before uploading.
Which components are impacted by your request?
No response
Pictures
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Hi thanks for checking out the project!
I originally made it like this but opted out of it since it can be inconsistent and not work across multiple devices on the client-side, also it adds another package to bundle.
I will deliberate whether to add this as an optional feature. I'm already planning on allowing more configuration for file uploads (like max size) in an upcoming update.
Thanks Danny! This is particularly important for mobile, where uploading a picture you just took is a great use case - but downsizing is clumsy. In any case, I'm grateful for your work on the wonderful project!
can i work on this? @danny-avila
Even I would Love to collaborate @aniruddhapw @danny-avila
Feel free to submit a PR. Note that it should be optional as not all browser resize methods work across all browsers.
Also the backend resizing should not be disabled but the resulting browser dimensions should "prevent" it from resizing.
See here: https://github.com/danny-avila/LibreChat/blob/main/api/server/services/Files/images/resize.js