JPEG shows colored block corruption after SD card transfer — can it be recovered?

Asked 2/7/2016

4 views

2 answers

0

I copied JPEG photos from an SD card to my computer using a card reader, then deleted the originals from the card. Later I noticed that some images have colored bars/blocks over part of the photo, while the embedded thumbnail still looks normal. Does this point to file corruption during transfer? Why can a JPEG be affected this way, and is there any practical way to repair or reduce the corruption now that the originals are gone?

Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0

Photography Stack Exchange contributor

10y ago

2 Answers

6

Short Answer : you may be lucky !

As you supposed, it seems that you have indeed experienced some corruption(s) during the transfer. Technically speaking, a JPG is made of tiny blocks of pixels called "MCU block" (Minimum Coded Unit). In the case of your image, the MCU has the size of 16*8 pixels (regular sizes are 8*8, 8*16 and 16*8). As one can see in your image, corruption appears indeed as blocks.

zoom on the first corrupted block

Generally, if a block gets corrupted during the transfer, all the following blocks are "corrupted". If you are lucky, the information is still there on your hard drive, but misaligned somehow. So when an image viewer try to read your image, it shows weird colors and misaligned lignes (basically, if your image viewer displays something, you can probably recover the displayed part of your image... but probably not the whole image).

If only such a corruption occurs, you can try to correct it manually. You will lose the data from the corrupted blocks but might be able to recover the others.

WARNING : as most "repair" procedures will alter your image, make a copy of it before trying to repair it.

I managed to recover this image using a free tool called "JPEG Repair Shop" (JRS) from Anders Pedersen (http://anderspedersen.net/jpegrepair) :

Repaired image (blocks are still corrupted)

Basically, all you have to do is load an image, find the first corrupted block and click on "Fix Colors". Sometimes, the "Fix Colors" options will still give strange colors. In this case, you can also add/remove MCU blocks and then try to fix the colors again.

You can see that almost all the image is now OK. Some blocks are still corrupted. You can see them in red in the following image :

Repaired image (corrupted blocks in red)

Finally, using Photoshop and the clone stamp or the content-aware filling tools, you can obtain this :

Repaired image

Some other tools may be able to get better result, maybe you can use PhotoShop to do everything, but I don't know how.

Originally by user26456. Source · Licensed CC BY-SA 4.0

user26456

10y ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

Yes — this strongly suggests the JPEG file was corrupted during or after transfer. JPEGs are encoded in small blocks, so corruption often appears as colored bars or blocky misalignment. The fact that the embedded thumbnail looks fine is a clue: the thumbnail is stored separately inside the file, so the main image data can be damaged while the thumbnail remains intact.

Why it happens: any file can be corrupted during transfer or storage because of a bad card reader, faulty cable/port, SD card errors, disk issues, or interrupted writes. JPEGs just make the damage visually obvious.

Recovery is limited, but you may be lucky. Sometimes the data is present but misaligned, and specialized JPEG repair tools may recover part of the image. In many cases, though, the damaged area cannot be fully restored. You can also extract the embedded thumbnail, but it will be much smaller than the full image.

Best next steps:

  • stop editing or resaving the damaged file
  • make a backup copy first
  • try JPEG repair/recovery software
  • check the SD card, reader, and destination drive for errors
  • in future, verify copies before deleting originals

UniqueBot

AI

10y ago

Your Answer