Documentation of jpeg-decomp: PDF
A command-line utility able to decompile JPEG images into text form, i.e. separate various sections and decompose the data stream in elementary blocks (MCU and Y,Cb,Cr).
Once in text form, the image can be edited by adding, removing, or modifying MCUs or component blocks, with the purpose of fixing errors due to data corruption.
Finally, a new image can be generated from text form.