Paris

by Jon

submit your photo


Hall of Fame
View past winners from this year

Please participate in Meta
and help us grow.

Take the 2-minute tour ×
Photography Stack Exchange is a question and answer site for professional, enthusiast and amateur photographers. It's 100% free, no registration required.

I damaged some of my NEF-files by using a script using ExifTool on subdirectories: I copied the exif-information from the original JPG to created JPG, using "-tagsFromFile -overwrite_original_in_place". Unfortunately I did overlook that the ad-hoc-script copied to NEF as well.

Somehow the makernotes or whatever seem to be scrambled/removed, so that the higher-level-programs like AdobeRaw/Adobe DNG Converter, RawTherapee or RawDrop are stumped. RawTherapee just crashes on opening the file, CS4 tells me that it "Could not complete your request as it is not the right kind of document."

It is not a tragic accident, as I already did create colour-corrected final JPG versions, but it unnerves me. Other programs like XnView and IrfanView still get along fine, I guess that they apply some inbuilt default. Picasa on the other hand produces garbage, as RawDrop does: pictures are extremely dark.

Is there a solution to this?

Concerning Backup: As the NEF still looked fine in XnView I did not notice them being damaged until after I overwrote the backup. Wanted to have a look at the capabilities of ViewNX concerning NEF ... and ViewNX did display nothing.

Example: See here

EDIT: PS: I already tried removing all EXIF, did not help. Sorry, forgot to mention.

share|improve this question
1  
Tangential thought: This is one reason why good backup software would do well to include SHA1 (or similar) checksums of your files. You'd still be out of luck if you overwrote a backup, but maybe the software could warn you before you get to that point. –  lindes Mar 16 '11 at 18:33
    
If you could email me a sample I will take a look to see what can be done. My mail is phil at owl.phy.queensu.ca –  user4336 Mar 16 '11 at 18:33
    
@lindes: or to put it another way, with my sysadmin hat on: simply copying your files to another drive does not create a backup. –  mattdm Mar 17 '11 at 0:57
    
Checksums would not do too much good here. NEF contain legitimate EXIF and I write my GPS into it. Of course, incremental backups would have helped. Sometimes I'm not very thorough, normally I apply three backup stages ... :) –  Leonidas Mar 17 '11 at 3:48

2 Answers 2

up vote 3 down vote accepted

I've taken a look at your linked image. The problem is that the following crucial information is missing from the NEF maker notes: NEFCompression, ContrastCurve, LinearizationTable. Presumably this happened because the maker notes were copied from a JPEG image, which doesn't contain this information.

The best you can do is to copy the makernotes from an original NEF image to replace the makernotes in the affected NEF's. This can be done with the following command:

exiftool -tagsfromfile good.nef -makernotes bad.nef

After this, most of the maker notes of no longer correspond to the original image, but you can recover what you can from the JPEG version of the maker notes by executing this command afterwards:

exiftool -tagsfromfile bad.nef_original -makernotes:all bad.nef

This will copy the existing individual maker notes tags back again. (Note that the 2 steps are necessary because maker notes tags may not be created individually, so copying the entire MakerNotes block was the only way to get the necessary tags back into the image.)

When you are done, you should have a usable NEF image, although the linearization may be slightly different so the levels might not be quite the same as they were originally.

share|improve this answer
    
Looks good, thanks. –  Leonidas Mar 18 '11 at 12:44

Make a copy of the raw file and use ExifTool to manipulate the metadata until the raw file can be read by your preferred raw converters. I would first try removing all the metadata to see what happens. Maybe just removing the (possibly corrupt) maker notes data would work. You may be able to inspect a non-corrupt raw file to see what's different in the metadata, and manually add, modify or delete tags using ExifTool until the metadata set looks correct. I hope this leads you to making your raw file usable.

share|improve this answer
    
The hard way comparing EXIF to EXIF in NEF. I guess it will come to that, there is one file I'd like to reprocess (else I wouldn't have asked at all, lost is lost). –  Leonidas Mar 17 '11 at 3:51
    
Phil offered the nice and easy way. The makernotes seem to be most important. –  Leonidas Mar 18 '11 at 12:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.