I had some NEF files in a folder that I didn't do anything with.
When importing them in Lightroom, no previews and a "file unsupported or damaged message"
So I tried with Nikons ViewNX, nothing. Even not in DxO or PhotoMechanic.
I had a look with EXIFTool and the corrupt file prints me only this:
ExifTool Version Number : 8.39
File Name : _DSC5559.NEF
Directory : /Users/tunafish/Desktop
File Size : 12 MB
File Modification Date/Time : 2010:11:29 12:46:56+01:00
File Permissions : rwxrwxrwx
Error : File format error
I tried to copy over the makernotes from a good file (_DSC5556.NEF) with
exiftool -tagsfromfile _DSC5556.NEF -makernotes _DSC5559.NEF
but EXIFTool gives me this error
Error: Not a valid TIFF - _DSC5559.NEF
0 image files updated
1 files weren't updated due to errors
I have uploaded 2 NEF's, with _DSC5559.NEF being the corrupt one here:
Corrupt_NEF.zip (http://antonputtemans.com/uploads/Corrupt_NEF.zip)
Hi,
I'm not sure if damaged NEF can be put together (another question is, if it worth).
Here's extracted preview from damaged NEF file -so you have at least something :)
Bogdan
Hi, it's not really worth it (in my case), but surely interesting.
Can you tell me how you extracted the preview?
Cheers
First approx 3Mb of data inside damaged file is (I assume) junk. That is, the content of NEF file starts at offset 350000hex -after I discovered that, I simply cutted that 3Mb of data at beginning. Now, because header of NEF file (incl.metadata) became intact, Exiftool was able to read the content of NEF file and extract preview image.
Good exercise for brains, though :)
Greetings,
Bogdan
ok, what tools are you using for this? just a hex editor?
Yes, hex editor only.. and a bit of luck.
Bogdan
Hi,
I am having similar problem. File system on my memory card got corrupted and I can't open some of the photos. Can you explain little bit, how you managed to extract preview from NEF file?
Or maybe someone knows other methods how to do that?
The brute-force method is typically to open the raw image in a hex editor, then look for the byte sequence "ff d8 ff", which could be the start of an embedded JPEG image. Then save everything from the "ff d8 ff" onwards to another file with a .JPEG extension, and try to open it. There are various-sized JPEG images in RAW files, so look for other "ff d8 ff" patterns in the file until you find the largest JPEG. After you do this for one image, the JPEG may be in a similar location for other RAW files from the same camera.
I can't comment on any good hex editors or utilities to extract part of a file since I write my own scripts to do things like this.
- Phil
Hi,
While typing, I just saw Phil's advice -which is correct, of course.
But after typing almost half an hour, I refuse to discard my "work" :) So here it goes...
I can't say I'm an expert on this, but in general:
Success on recovering any corrupted file depends from case to case. But most important is, to know internal structure of the file you try to recover (NEF file, in your case). The chances to fully recover file(s) are bigger if one can "examine" corrupted files while they are still on (corrupted) media. Otherwise, you can be happy if it's possible to "extract" preview image only.
It's impossible to give some "step by step" instructions, because solution (recovery steps) depend from case to case. And one can't say in advance if it's possible or not: file must first be "seen" as written on media. Anyway, recovery process is full manually and can take a lot of time -worth only if images are very important to you.
Extracting Jpg preview from damaged NEF file is similar to recovering complete NEF file: one must know internal jpg file structure in this case. However, chances on success, are (statistically) better. Let me explain:
Let's say complete NEF file is 16 MBytes, while embedded Jpg image inside NEF is only, say, 2 MBytes. Now, it depends only on bad luck that exactly these 2 MBytes of data is corrupted as well. Ok, first embedded jpg image must be found inside NEF, so knowing NEF structure is important again...
Sorry I couldn't help... IMO, only a "geek" familiar with NEF format and your memory card in his hand, has chances to do something.
Bogdan
Thanks to you both. Tried hexeditor, but could not locate any jpg files in damaged NEFs. Tried this on healthy ones, and they were there. So I guess my files are corrupted beyond repair. Not that it is question of life and death (lucky me) but at least a learned something today :)