Sunday 29 December 2019

software - Damaged RAW (NEF)-files: ideas?


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.



Answer



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.


No comments:

Post a Comment

Why is the front element of a telephoto lens larger than a wide angle lens?

A wide angle lens has a wide angle of view, therefore it would make sense that the front of the lens would also be wide. A telephoto lens ha...