I'm the developer of MakeQuickWork, a small set of free browser tools. This is how its Remove EXIF tool works, including two bugs I found while taking the screenshots for this post.
The usual way to strip EXIF in a browser is to draw the image to a canvas and export it again. It works, and it's also a full decode and re-encode: you lose some quality, you lose the colour profile, and the file size jumps around. I wanted the opposite. Same pixels, same bytes for the image data, only the metadata gone.
So the tool doesn't touch the image at all. It rewrites the container. JPEG, PNG and WebP are all formats where metadata lives in separate, clearly labelled blocks, which means you can walk the file, skip the blocks you don't want and copy the rest.
The page is https://makequickwork.com/image/remove-exif/ . It runs in the tab; the photo isn't uploaded.
JPEG: walking the markers
A JPEG is a sequence of segments. Each starts with 0xFF plus a marker byte, and most carry a two-byte big-endian length.…