graasp / graasp-account

GNU Affero General Public License v3.0
0 stars 2 forks source link

fix: avatar upload size error #250

Closed spaenleh closed 4 months ago

spaenleh commented 4 months ago

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 ?

ReidyT commented 4 months ago

@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 commented 4 months ago

@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.

sonarcloud[bot] commented 4 months ago

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