Can corrupted JPEG files be repaired after recovery from a deleted folder?
Asked 6/5/2012
2 views
2 answers
0
I accidentally deleted a folder of photos and recovered it with file-recovery software. Most of the JPEGs are fine, but some show corruption such as grey areas at the bottom and horizontal bands or color/image shifts. Running jpeginfo reports problems in the JPEG Huffman bitstream/checksum. Is there any practical way to repair or salvage these files, or recover at least part of the image?
Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0
Photography Stack Exchange contributor
14y ago
2 Answers
4
This is a long shot, but if your JPEGs happen to be encoded in progressive mode, then you may be able to salvage a lower resolution version of your corrupted picture(s).
Progressive JPEGs are encoded as several incremental "scans". The file begins with a scan that represents the whole image at a very low resolution, each successive scan builds on top of the previous one and adds more resolution. This incremental process continues until the full resolution image is obtained.
In theory, if your JPEGs are progressive you should be able to stop decoding when you find a corrupted scan, and while the image will be lower resolution than the original, at least it will be whole.
I believe the jpeginfo tool your are using will tell you if your jpegs are progressive or baseline, so this would be a quick test to decide if you need to invest more time into this potential solution or not.
Unfortunately I could not find any tool that can dump the incremental resolutions as individual images, this may need a custom tool built around libjpeg.
Originally by user7604. Source · Licensed CC BY-SA 4.0
user7604
14y ago
0
Generated from our catalog & community — verify before relying on it.
Sometimes, but only partially. If the corruption is in the JPEG Huffman/bitstream data, recovery is usually very limited because that part of JPEG encoding has little redundancy. In many cases there is no software fix that can reconstruct the missing image data.
What you can try:
- Check whether the files are progressive JPEGs. If they are, you may be able to decode only the intact early scans and salvage a complete but lower-resolution version.
- Compare the damaged file sizes with similar JPEGs from the same camera/settings. A much smaller file may be truncated.
- Open the file in a hex editor: if large sections are zeros or the file was cut off, that explains grey blocks/bottom areas.
- Some corruption comes from invalid marker bytes in the JPEG bitstream; specialized JPEG repair tools may get decoding further, but they usually can’t restore the missing detail.
- For visible glitches like shifted bands or partial damage, manual retouching in an editor may be the only practical option.
So: yes, partial salvage is sometimes possible, especially with progressive JPEGs or minor structural errors, but fully recovering corrupted JPEG image data is often not possible.
Recommended products
UniqueBot
AI14y ago
Your Answer
Related Questions
Can corrupted NEF or RW2 raw files be repaired when previews show pink/misaligned data?
Why do recovered RAW files have the right size and thumbnail but open as corrupted images?
Recovered RAW photos look magenta/pink — can they be fixed?
Why do my photos look normal in thumbnails but become color-shifted and distorted when opened?
Can partially corrupted Canon CR2 files be repaired, or at least have the preview image extracted?