ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: tknogeek on January 12, 2020, 11:42:58 PM

Title: Corrupted NEF file repair for Nikon Z50
Post by: tknogeek on January 12, 2020, 11:42:58 PM
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.
Title: Re: Corrupted NEF file repair for Nikon Z50
Post by: StarGeek on January 12, 2020, 11:49:42 PM
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
Title: Re: Corrupted NEF file repair for Nikon Z50
Post by: tknogeek on January 12, 2020, 11:52:24 PM
Thanks. I'll get her working on creating those in case he wants them.
Title: Re: Corrupted NEF file repair for Nikon Z50
Post by: Phil Harvey on January 13, 2020, 08:23:53 AM
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
Title: Re: Corrupted NEF file repair for Nikon Z50
Post by: tknogeek on January 18, 2020, 09:41:21 AM
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!   :)
Title: Re: Corrupted NEF file repair for Nikon Z50
Post by: Phil Harvey on January 24, 2020, 12:50:01 PM
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
Title: Re: Corrupted NEF file repair for Nikon Z50
Post by: tknogeek on January 24, 2020, 01:33:15 PM
Thanks for the update.

Meanwhile, I'll confirm her Lightroom settings to ensure it is set to not attempt to save metadata to NEFs.
Title: Re: Corrupted NEF file repair for Nikon Z50
Post by: Phil Harvey on January 27, 2020, 10:32:51 AM
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
Title: Re: Corrupted NEF file repair for Nikon Z50
Post by: Phil Harvey on January 27, 2020, 12:18:42 PM
What O/S are you running?  I may have to make a version of fix_corrupted_nef specifically for the Z50.

- Phil
Title: Re: Corrupted NEF file repair for Nikon Z50
Post by: tknogeek on January 27, 2020, 12:45:08 PM
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.
Title: Re: Corrupted NEF file repair for Nikon Z50
Post by: Phil Harvey on January 27, 2020, 01:32:01 PM
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 (https://exiftool.org/fix_corrupted_nef.html).

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
Title: Re: Corrupted NEF file repair for Nikon Z50
Post by: tknogeek on January 27, 2020, 08:23:05 PM
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.   ;)
Title: Re: Corrupted NEF file repair for Nikon Z50
Post by: Phil Harvey on January 27, 2020, 09:18:25 PM
Excellent.  I'm glad that I could help.

- Phil