Extracting Preview from Corrupted CR2 - Troubleshooting

Started by flux-capacitor, August 20, 2018, 04:07:13 PM

Previous topic - Next topic

flux-capacitor

Hello everbody,
I came across ExifTool earlier today while doing a Google search on fixing some corrupted CR2 Files of a Canon 5D MK IV

Based on this thread on the forum I tried several things but none have worked out so far.

https://exiftool.org/forum/index.php/topic,4172.msg19803.html#msg19803

I like to mention that the .cr2 Files are recovered Files and are oddly huge with around 90MB per File while 40MB should be the normal Filesize.

I'm not familiar with code and here is quick rundown of the things I tried.

exiftool -PreviewImage -b /Users/stephan/Desktop/Test/020364.CR2 > /Users/stephan/Desktop/Test/020364.jpg

Warning: Invalid XMP - /Users/stephan/Desktop/Test/020364.CR2

This created a 0KB JPG File and the invalid XMP File Message might a hint for some with more experience in this matter.

The other thing I tried was to follow the description of the other thread with extract preview script:

cd ~/Desktop
./extract_preview /Users/stephan/Desktop/Test/020364.cr2

[extract_preview version 1.04]
===== /Users/stephan/Desktop/Test/020364.cr2
----- Summary
    1 files processed
    0 previews created:

I'm happy for any assistance in this case.

All the best,
Stephan



Phil Harvey

Hi Stephan,

One test to run: How big is the CR2 file if you ZIP it?  If it is less than a couple of megabytes then you probably don't have any useful data in the file.  If it is bigger, send me a sample and I'll take a look (philharvey66 at gmail.com).

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

flux-capacitor

Hi Phil,
thank you for the reply. I just send you an email with some testfiles.
After Zipping the CR2, the Filesize shrunk from 90MB to arround 60MB, so there might be some data left.

All the Best,
Stephan

Phil Harvey

Hi Stephan,

For each of these files, the first 4096 bytes are good, but this is followed by a bunch of zeros and then data which seems to be from random sectors on your disk.  So I don't think the original raw image is recoverable, but you might be able to find some usable JPEG's.  With my extract_preview script, using the -a option to extract all JPEG images, I can extract a total of 52 JPEG images from the 3 files you sent.  Most of these are 5040x84-pixel strips of thumbnail images, but there are a handful of useable preview-sized images and one full-sized JPEG.

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

flux-capacitor

Hi Phil,
thank you for the feedback.
I tried to add the -a option and it worked perfectly!
Both, interesting and scary what kind of JPGs Exiftool was able to recover from the RAW files.
The particular Images I was looking for weren't there but I have learned the mighty powers of this tool and will give it a shot soon on some other recovered Files.

Thank you for the help

All the Best,
Stephan