TASVideos / tasvideos

The code for the live TASVideos website
https://tasvideos.org/
GNU General Public License v3.0
62 stars 29 forks source link

Implement profile picture resolution verification #1732

Closed Masterjun3 closed 1 month ago

Masterjun3 commented 6 months ago

We currently have a policy to limit profile pictures to 125×125 pixels. But because users don't upload profile picture files to our server, it's not possible to let the server automatically check or downscale the resolution as suggested in #1711 .

Instead, we should use JavaScript to verify the new profile picture resolution on the client! This should be easy to implement and solve the problem nicely, with a verification error message to the user about how their image is too large. (Client-side verification can be circumvented of course, but that's not a problem, because we can remove wrong profile pictures manually.)

nattthebear commented 6 months ago

Yes, we should be able to get naturalWidth and naturalHeight of the image in JS without a CORS demand.

adelikat commented 1 month ago

Unfortunately the filesize IS a CORS demand so that's not an option. And we are currently checking width and height on the client size and providing an error. So we have done what we can, so closing the ticket