open-chat-labs / open-chat

This is the main repository for the OpenChat application which runs on the Internet Computer
https://oc.app
GNU Affero General Public License v3.0
170 stars 52 forks source link

Remove GPS coords from uploaded photos #6336

Open megrogan opened 1 month ago

julianjelfs commented 1 month ago

Round-tripping the image to canvas (as we do for resizing) is the easiest way to remove meta-data. So one solution is to simply resize all images rather than just those that exceed limits. This is probably a reasonable thing to do as most camera images are unnecessarily big for web rendering.

One exception would be gifs as converting them via canvas breaks the animation.

We cannot use the same approach for videos though which will almost certainly require server side processing (which we already need to do ideally to transcode to ubiquitous format).

julianjelfs commented 1 month ago

This is done for images, but could still be an issue for video. There is no easy way to deal with this on the client. For video it could and should be done as part of transcoding (which we also should be doing).