Corrupted NEF file repair for Nikon Z50

Started by tknogeek, January 12, 2020, 11:42:58 PM

Previous topic - Next topic

tknogeek

Phil,

It appears the problem of NEFs corrupted by Nikon Transfer 2 continues with the Z50. I attached an Excel file demonstrating the differences in EXIF data for two files. One file is good and can be opened with Photoshop while PS is unable to open the other that was modified by Transfer 2. I have the original NEFs, if needed.

I'm certain the photographer would be very gratified if her files from the past 3 weeks can be "recovered."

Thank you for any help/guidance you can offer.

StarGeek

Phil may need a variety of samples if are able to get them.   Here's what he needed in a previous post to use as a guide, though it will be up to him how much he actually needs.

Quote from: Phil Harvey on January 17, 2014, 01:52:21 PM
This is my first request for D700 support.  To add support for the D700 I will need a set of 12 test images comprised of the following 6 images a) copied directly from the camera's memory card, and b) corrupted by the Nikon software:

1) 12-bit compressed
2) 12-bit lossless compressed
3) 12-bit uncompressed
4) 14-bit compressed
5) 14-bit lossless compressed
6) 14-bit uncompressed
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

tknogeek

Thanks. I'll get her working on creating those in case he wants them.

Phil Harvey

Yes, if you can get me these images I'll see what I can do when I get back from vacation at the end of next week.  My email is 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 ($).

tknogeek

Files sent. The Z50 doesn't give the option to change compression, so we only have 4 unique combinations of parameters (2 bit depth values, 2 states each [good/bad]).

Thanks for any help you can offer!   :)

Phil Harvey

I got the samples.

It looks like these images are repairable.  It will take some effort for me to add support for the Z50 to my fix_corrupted_nef utility, but I am hopeful it will work.  I'll get to this as soon as i can but may be a week or so.

Note that all of your files have been modified by some Adobe utility, which is very dangerous because it could destroy the image if you do this after the image is corrupted by Nikon Transfer 2.

- 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 ($).

tknogeek

Thanks for the update.

Meanwhile, I'll confirm her Lightroom settings to ensure it is set to not attempt to save metadata to NEFs.

Phil Harvey

Wow.  This is going to be more work than I thought.

As well as messing up the raw image metadata in SubIFD1, some of the tags in SubIFD3 and SubIFD4 have also been pooched.  I haven't seen this for other models, and it will take some specialized code to be able to fix this.  What a mess.

- 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 ($).

Phil Harvey

What O/S are you running?  I may have to make a version of fix_corrupted_nef specifically for the Z50.

- 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 ($).

tknogeek

She is running Windows 10 (presumably with latest updates as of the original post). If you need more specific version info, I can get that this evening.

I have no explanation for the indication of Adobe in the metadata. To my knowledge, the "bad" images were pulled directly from the camera using Nikon Transfer 2. The "good" images were copied using File Explorer. The camera was connected to the PC via the Nikon USB cable for both scenarios.

She really appreciates your help. She's hoping to be able to recover a couple thousand photos from a few wildlife outings.  She's no longer using Transfer 2, so she's good for day forward operations.

Phil Harvey

OK.  I figured out a way to patch the existing fix_corrupted_nef utility to add support for the Z50 madness.

You can download the new version here.

I tested it here but the only software I have that will convert a Z50 NEF is the Adobe DNG converter.

So let me know how it works for you.

- 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 ($).

tknogeek

#11
Version 3.3 appears to "un-corrupt" the two "bad" Z50 images we provided. Both of the fixed images were imported successfully into Photoshop (via Adobe Camera Raw) and Lightroom Classic. Awesome work! Thanks!

...and we found the "donate" link.   ;)

Phil Harvey

Excellent.  I'm glad that I could help.

- 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 ($).