What this repair can recover
JPEG stores a compressed scan between structural markers. If those pixels still decode, rewriting the frame produces a conventional new JPEG and discards broken metadata, trailing bytes and a missing final marker. This is especially useful when one application rejects a loosely formed file that the browser can still read.
The new file is a fresh lossy encoding at high quality. It is not byte-for-byte restoration, and metadata is intentionally not copied from a suspect container.
Where recovery must stop
- Missing or overwritten compressed scan data cannot be reconstructed from the remaining bytes.
- A partially decoded image may contain a grey or broken lower region; rewriting preserves that visible result rather than inventing unseen pixels.
- Keep the original damaged file. A forensic or specialist decoder may recover more than a browser can.
Repair the picture rather than its container
- RepairImageDetection, an editable mask and the fill, on one column.
- Scratches and dustOpens with detection turned up and the brush already out.
- Narrow print creasesThe local fill opened at its widest reach for a thin fold with intact picture on both sides.
- Repair a PNG fileVerify chunks and CRC checksums, then losslessly rewrite any complete surviving frame.