Skip to content
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

fix: avatar upload size error #250

Merged
merged 5 commits into from
Jun 11, 2024
Merged

fix: avatar upload size error #250

merged 5 commits into from
Jun 11, 2024

Conversation

spaenleh
Copy link
Member

In this PR I fix an issue where the user avatar picture was artificially growing in size before being sent to the backend. This resulted in a silent error and failure to update the avatar picture. With this PR I update the code that handles cropping and creating a new image. It uses lossy compression to reduce the file size and ensure we do not hit the limit of 10Mb that we fixed for file uploads.

Maybe this component should be moved to UI alongside a custom hook to compute the image crop. @ReidyT were you working on that recently ?

@spaenleh spaenleh self-assigned this Jun 10, 2024
@spaenleh spaenleh added the bug label Jun 10, 2024
@ReidyT
Copy link
Contributor

ReidyT commented Jun 10, 2024

@spaenleh I started the move to the UI, but as I thought it wasn't a priority, I haven't finished and scheduled for later. It is urgent for now ?

@spaenleh
Copy link
Member Author

@ReidyT No not urgent. Just wanted to know what the status of that was, so I could maybe add this fix there and we would not have to duplicate the code too much. Lets discuss this.

@spaenleh spaenleh marked this pull request as ready for review June 10, 2024 09:02
@spaenleh spaenleh requested review from pyphilia and ReidyT June 10, 2024 09:02
Copy link
Contributor

@ReidyT ReidyT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a small issue in a comment 🚀

src/components/main/CropModal.tsx Outdated Show resolved Hide resolved
@spaenleh spaenleh force-pushed the fix-avatar-upload-size-error branch from 7874986 to aaedbb3 Compare June 10, 2024 13:58
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@spaenleh spaenleh added this pull request to the merge queue Jun 11, 2024
Merged via the queue into main with commit 6c113ae Jun 11, 2024
5 checks passed
@spaenleh spaenleh deleted the fix-avatar-upload-size-error branch June 26, 2024 06:33
spaenleh pushed a commit that referenced this pull request Nov 14, 2024
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
spaenleh pushed a commit that referenced this pull request Nov 26, 2024
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
spaenleh pushed a commit that referenced this pull request Jan 23, 2025
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants