What happens when you drop a file
- Your browser reads the file from your disk into the memory of this page. This is the same thing that happens when you preview a photo before attaching it to an email.
- The page hands the file to a background thread in your browser. That thread runs the compression code, which was downloaded with the page as WebAssembly.
- The result is handed back to the page as a new file in memory, and the Download button saves it to your disk.
At no point is the file, its name, or anything derived from its contents sent over the network.
What does travel over the network
Only the site itself, coming to you:
- The page: HTML, styles and a small script.
- The compression code for the format you use, fetched the first time you use it. For example, the JPG encoder is downloaded the first time you compress a JPG.
These are ordinary downloads from this site to your browser. Nothing goes in the other direction.
Test it in 30 seconds
You do not need to trust this page. You can check.
- Open any tool and compress one picture, so that the compression code is loaded.
- Turn off Wi-Fi, or switch your device to flight mode.
- Drop in a different picture of the same type.
It still works, because the work never needed a server. If you are comfortable with developer tools, the Network tab tells the same story: while a file is processed, no request carries it anywhere.
The command that publishes this site runs this same check first, in three browsers, and stops if a file is sent over the network while it is being processed.
The rule your browser enforces
The pages also carry a security policy that tells your browser to refuse connections to any other site, so the code here could not send a file elsewhere even by mistake. This is the policy, exactly as this site sends it:
default-src 'self'; script-src 'self' 'wasm-unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' blob: data:; worker-src 'self' blob:; connect-src 'self'; frame-ancestors 'none'; base-uri 'self'; form-action 'none'; object-src 'none'
connect-src 'self' means the page may only talk to kotelo.co itself. form-action 'none' means no form on it can be submitted anywhere. You can read the same policy in your browser's developer tools, under the response headers of this page.
Why it is built this way
There are three reasons, and privacy is only the first.
- Private: a file that is never uploaded cannot be stored, leaked or looked at.
- No upload wait: the file does not have to travel anywhere first.
- No daily limit: your device does the work, so there is no reason for a daily cap or a queue.
Limits worth knowing
Working on your device has edges. Very large pictures, above 80 megapixels, are turned away. Older phones are slower than a server would be, especially for AVIF. And a tool can only open the formats your browser can open.