social-app
social-app copied to clipboard
When uploading multiple images the "file is too large" message is confusing
Describe the bug
When trying to upload multiple images, if one or more of those images is larger than the max filesize you get a generic error banner stating "This file is too large. It is X MB but the maximum size is Y KB." that doesn't tell you which image(s) is too large.
To Reproduce
Steps to reproduce the behavior:
- Create a skeet with multiple images where one of those images is larger than 976.56KB
- Attempt to post it.
Expected behavior
Somehow indicate which image(s) is too large (maybe a ! on the image(s) or something?
Screenshots
Details
- Platform: Desktop firefox windows
- Platform version: windows 10, ff 113.0.1
- App version: Build version TODO (TODO) (I know that's not helpful but like...)
Additional context
~~Further testing makes it seem like the file size limit is actually on the sum of all images rather than any individual image?~~ Actually I just tried uploading the exact same pictures from mobile and it worked fine, so maybe there is some other issue on desktop? Either way the error message is a little weird.
Hi there! Ideally you shouldn't hit this anymore after https://github.com/bluesky-social/social-app/pull/737 gets merged. Currently there's two rounds of compression, which is a bit odd.
The new changes will do compression right before upload and attempt to find the lowest possible compression in increments of 0.1 such that it meets the upload limit. Unless you're uploading images with some wild noise, it should cover a large percentage of image uploads :)
Awesome! Thank you!
there seems to be something off about the file size limits. I have a 500 kb file locally, but it still says its 1.34 mb and therefore too large when I upload it. The same file with a different name and in a different browser (firefox vs chrome) is over 1.5 mb. Maybe this is unrelated and there is just something off about how the filesize is calculated. I will take a closer look at it.
okay so with cropping it works. Without cropping it does not. Even though the file should be small enough.
maybe this image file size calculation is too clever: https://github.com/bluesky-social/social-app/blame/200bbce66eb9dee046075471b33d5dd5eb448758/src/lib/media/util.ts#L7
I uploaded a picture of my breakfast here: https://bsky.app/profile/spirobel.bsky.social/post/3jwoamovki22x in the uncropped image code path the file size was off by a lot. Was not able to upload it in its natural uncropped form.
@spirobel apologies for the late reply! Can you let me know if the behavior is still persisting?
This should be fixed