4
\$\begingroup\$

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.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ 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. \$\endgroup\$
    – lindes
    Mar 16, 2011 at 18:33
  • \$\begingroup\$ 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 \$\endgroup\$
    – user4336
    Mar 16, 2011 at 18:33
  • \$\begingroup\$ @lindes: or to put it another way, with my sysadmin hat on: simply copying your files to another drive does not create a backup. \$\endgroup\$
    – mattdm
    Mar 17, 2011 at 0:57
  • \$\begingroup\$ 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 ... :) \$\endgroup\$
    – Leonidas
    Mar 17, 2011 at 3:48

2 Answers 2

4
\$\begingroup\$

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.

\$\endgroup\$
0
2
\$\begingroup\$

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.

\$\endgroup\$
2
  • \$\begingroup\$ 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). \$\endgroup\$
    – Leonidas
    Mar 17, 2011 at 3:51
  • \$\begingroup\$ Phil offered the nice and easy way. The makernotes seem to be most important. \$\endgroup\$
    – Leonidas
    Mar 18, 2011 at 12:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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