ExifTool Forum

General => Metadata => Topic started by: Rescuepupmama on November 12, 2021, 08:49:36 AM

Title: Metadata loss on Nikon Z6 NEF files
Post by: Rescuepupmama on November 12, 2021, 08:49:36 AM
Hello everyone! This is my 1st post here. I'm going to get this right out there, I am NOT a techie.  I'm currently using a Nikon Z6 and an iMac with Mac OS Catalina. I have a dilemma with some NEF files seemingly being corrupted, but I have no clue what happened. I did the shoot on October 24th, and uploaded my files to an external HD connected to my iMac that same night. I also edited one of the photos as a "sneak peek" for the client. I had 4 shoots in 2 weeks, this one being the 2nd of the 4, and formatted the XQD card each morning of each shoot.

Fast forward to last week when I went to complete the editing on this particular session, and about 2/3 of the NEF files won't open, including the one I used for the sneak peek. Needless to say I'm at a loss as to what happened. I didn't move the folder with the files. I'm attaching an image of the "Get info" on two files in case it helps any sleuths on here. After asking around on another forum and doing some digging, it seems the colour profiles are gone? I tried Exiftool but it wasn't able to open any RAW files.  Is tehre anything else I can try with it?  Thanks all for your time!
Title: Re: Metadata loss on Nikon Z6 NEF files
Post by: Phil Harvey on November 12, 2021, 08:58:48 AM
If you have ExifTool, run it on the file to see what you get.

Also, you can try to zip the file... if the size goes down significantly it is probably empty.

Finally, if you can upload a sample we can take a look for you.

- Phil
Title: Re: Metadata loss on Nikon Z6 NEF files
Post by: Rescuepupmama on November 12, 2021, 09:21:17 AM
I'm trying to run the tool again now, in the meantime I tried to attach a sample "bad" NEF but it's too large.  I zipped it, and it went from 30mb to 29.3mb.  I really appreciate the fact you're willing/trying to help!

Title: Re: Metadata loss on Nikon Z6 NEF files
Post by: Phil Harvey on November 12, 2021, 09:22:32 AM
If you could upload the file to a filesharing service (like wetransfer or dropbox) that would work.

- Phil
Title: Re: Metadata loss on Nikon Z6 NEF files
Post by: Rescuepupmama on November 12, 2021, 09:26:28 AM
https://www.dropbox.com/s/inzw2s0kjr5cssy/DSC_4989.NEF?dl=0

Title: Re: Metadata loss on Nikon Z6 NEF files
Post by: Phil Harvey on November 12, 2021, 10:53:31 AM
I have seen this type of corruption before.  The disk sectors have been scrambled, and the file contains random data from other files on the disk.  Recovering the original raw data would be very difficult, but extracting the embedded JPEG images is relatively easy.  See this post (https://exiftool.org/forum/index.php?topic=4172.msg19805#msg19805).  For the image you provided, I can extract 3 JPEG's:

> extract_preview -a tmp
[extract_preview version 1.04]
===== tmp/DSC_4989.NEF
Found JPEG (640x424 pixels, 126532 bytes at offset 9218560)
Found JPEG (1620x1080 pixels, 592003 bytes at offset 11711488)
Found JPEG (6048x4024 pixels, 1060335 bytes at offset 12303872)
  --> saved 3 previews
    1 files processed
    3 previews created:
        1 640x424
        1 1620x1080
        1 6048x4024
Done.


- Phil
Title: Re: Metadata loss on Nikon Z6 NEF files
Post by: Rescuepupmama on November 12, 2021, 11:20:43 AM
Oh wow, Phil!  Even a large JPEG would make my day!  Thank you!!!   I;m guessing in this case, if I copy the files to my downloads folder, that the code would look more like this?  I apologize for all the hand holding...

> extract_preview -a tmp
[extract_preview version 1.04]
===== downloads/DSC_4989.NEF
Title: Re: Metadata loss on Nikon Z6 NEF files
Post by: Rescuepupmama on November 12, 2021, 11:56:34 AM
This is what I got

Josees-iMac:Desktop joseelavoie$ ./extract_preview [-a].DSC_4980.NEF
[extract_preview version 1.04]
===== [-a].DSC_4980.NEF
Error opening file
----- Summary
    1 files not processed due to errors
    1 files processed
    0 previews created:
Done.
Title: Re: Metadata loss on Nikon Z6 NEF files
Post by: Phil Harvey on November 12, 2021, 12:10:16 PM
"tmp" is the name of my directory.  You should change this to "downloads".

Your second command didn't work because you added square brackets around -a, and left out the space before the file name.

But you don't need the -a if you want to extract only the largest preview in the file.

- Phil
Title: Re: Metadata loss on Nikon Z6 NEF files
Post by: Rescuepupmama on November 12, 2021, 12:14:15 PM
Thanks again.  I managed to get it right with the file I sent you, and it worked, although that image is from the shoot after the one in question....which is odd, because none from that shoot have the same file numbers, they're all in the 6000 range.  I guess they're lost.  Thanks again for all your help and patience though, I really do appreciate you taking the time.
Title: Re: Metadata loss on Nikon Z6 NEF files
Post by: Phil Harvey on November 12, 2021, 12:25:44 PM
Like I said, the disk sectors are probably scrambled, so the file names won't necessarily match the data.  If you recovered files from the disk, try extracting previews from all of the recovered files (even the non-NEF ones).

- Phil