Author Topic: Corrupted CR2 files can be fixed or not in HEX editor?  (Read 4631 times)

Constantin

  • Newbie
  • *
  • Posts: 6
Corrupted CR2 files can be fixed or not in HEX editor?
« on: June 06, 2014, 03:50:14 AM »
Hi, anybody who knows about HEX editor, I have a difficult task.

I have several CR2 Canon 5D2 raw corrupted files. Let's take one to discuss.
I open the CR2 file in HEX editor. It is known that every raw file has in it a JPEG preview info (which is the header of the picture) and RAW info. I managed to copy the RAW body of a corrupted picture to a undamaged one. (I am talking about the info from the last FF D8 until the very end which is FF D9) Save as...a new CR2 file and open in Canon software DPP. The result was amazing for me, as is the first time when I try this: in Preview I saw the undamaged picture and in the edit window the damaged one. So this is clear that the wrong info is in the body of the RAW file... The header is fine for every damaged picture, because I can save them as JPEG. But the problem is when I try to edit and actually see all the RAW picture.

My request is that is anybody here on this forum that can follow the sequences and can figure it out what is wrong?

I have a corrupted CR2 file at this link: http://we.tl/oVMfpYn3wm

Many thanks!

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16885
    • ExifTool Home Page
Re: Corrupted CR2 files can be fixed or not in HEX editor?
« Reply #1 on: June 06, 2014, 08:43:30 AM »
I won't be on a fast internet connection until Monday, but I will take a look at your image then.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Constantin

  • Newbie
  • *
  • Posts: 6
Re: Corrupted CR2 files can be fixed or not in HEX editor?
« Reply #2 on: June 06, 2014, 03:31:57 PM »
Thank you very much Phil! I'll wait for your opinion.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16885
    • ExifTool Home Page
Re: Corrupted CR2 files can be fixed or not in HEX editor?
« Reply #3 on: June 09, 2014, 07:35:52 AM »
I see what you are talking about now.  The raw image doesn't display properly, although the file doesn't appear to be otherwised damaged.  The metadata and the B&W JPEG preview image are intact.

It is funny that I can't see anything obviously wrong with the raw data.  It has the proper header and footer, and the structure looks good.  However, the developed image is garbage.

I'm sorry I can't be of much help here.  I don't know what is wrong with the image itself, and whether or not it can be fixed.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

MOL

  • Full Member
  • ***
  • Posts: 93
Re: Corrupted CR2 files can be fixed or not in HEX editor?
« Reply #4 on: June 09, 2014, 11:45:41 PM »
Constantin,

...in Preview I saw the undamaged picture and in the edit window the damaged one.

What you see in preview is the embedded JPG image, not the original RAW data. Damaged CR2 files are a very old problem, and most of the time it's a defective card reader, cable or USB port.  Some people even suspect Lightroom to corrupt Canon images.  In my experience there is almost no chance to restore a corrupted CR2 file such as yours.  If you're lucky, you can retrieve the embedded JPG with DCRAW - but that's pretty much it.  Check your hardware!

HTH
-Uwe

Constantin

  • Newbie
  • *
  • Posts: 6
Re: Corrupted CR2 files can be fixed or not in HEX editor?
« Reply #5 on: June 10, 2014, 02:33:46 AM »
Thank you HTH,

I'll keep in mind your advice and verify twice the connections, the card reader and the hard-drive.

Constantin


Constantin,

...in Preview I saw the undamaged picture and in the edit window the damaged one.

What you see in preview is the embedded JPG image, not the original RAW data. Damaged CR2 files are a very old problem, and most of the time it's a defective card reader, cable or USB port.  Some people even suspect Lightroom to corrupt Canon images.  In my experience there is almost no chance to restore a corrupted CR2 file such as yours.  If you're lucky, you can retrieve the embedded JPG with DCRAW - but that's pretty much it.  Check your hardware!

HTH
-Uwe

MOL

  • Full Member
  • ***
  • Posts: 93
Re: Corrupted CR2 files can be fixed or not in HEX editor?
« Reply #6 on: June 10, 2014, 10:45:08 PM »
Thank you HTH,

HTH means "Hope that helps"... :)

-Uwe

Constantin

  • Newbie
  • *
  • Posts: 6
Re: Corrupted CR2 files can be fixed or not in HEX editor?
« Reply #7 on: June 11, 2014, 03:11:52 AM »
Ups! Sorry, I didn't think of that...

Thanks Uwe!

Thank you HTH,

HTH means "Hope that helps"... :)

-Uwe