Nikon D800 NEFs ==> SubIFD Tags corrupted ==> Rewrite possible?

Started by spark, June 29, 2012, 11:09:04 AM

Previous topic - Next topic

joedfelipe

Hi Phil!

This has been an old thread but I'm still desperately finding solutions to my problem :'(. It seems that I'm also experiencing this kind of problem after viewing and rating my Nikon D7000 NEFs in an old version of ViewNX2 directly from the SD card. Only rated images have been 'corrupted' so far. I think this tool (fix_corrupted_nef) would help but it doesn't support the Nikon D7000. Can you make this tool also available for the D7000? I would really appreciate that. Thank you so much!  :)

Joed

Phil Harvey

Hi Joed,

I can implement support for the D7000 if you supply me with a full test set of 8 NEF images.  4 original images and 4 corrupted images with these settings:

1) 12-bit lossless compressed
2) 12-bit compressed
3) 14-bit lossless compressed
4) 14-bit compressed

You can either email these to me (philharvey66 at gmail.com), or upload them to a file sharing utility for me to download.

- 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

I got the samples, thanks.

This is not the same problem as the one solved by the fix_corrupted_nef utility.

The metadata for the corrupted image looks fine as far as I can tell (which is what fix_corrupted_nef fixes).

Instead, the raw image data is truncated in the corrupted image you sent, and 3791 bytes are missing.  The raw data is right at the end of the file, so presumably you could just add 3791 bytes to the end of the file and recover most of the raw image.

Also note that even the "original" NEF images you sent were modified by ViewNX 2.0.  This is bad (because Nikon software has a long history of corrupting NEF images and Nikon will give you no support when this happens).  You need to find a download technique that doesn't mess with your files.  I recommend avoiding the Nikon and Windows download utilities since they modify the files.

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

joedfelipe

Phil,

Thanks for taking time processing my samples. If that's the problem, how can I add 3791 bytes to the end of the file? I really don't have any idea on how to do that :(

Btw, I only used copy and paste from my SD card directly to my macbook pro then view it in ViewNX2 (I didn't use Nikon Transfer to download my files. Can the ViewNX 2 modify the image too just by viewing RAW images from it?

Joed

Phil Harvey

Hi Joed,

To add random bytes to the end of the file, on a Mac you can do this from the Terminal:

cat ANYFILE >> test.nef

where ANYFILE is any file that is at least 3791 bytes long.

Apparently ViewNX2 writes to the image when you just look at it:

> exiftool -software .
======== ./corrupted 14-bit lossless compressed.NEF
Software                        : ViewNX 2.0 M
======== ./original 12-bit compressed.NEF
Software                        : ViewNX 2.0 M
======== ./original 12-bit lossless compressed.NEF
Software                        : ViewNX 2.0 M
======== ./original 14-bit compressed.NEF
Software                        : ViewNX 2.0 M
======== ./original 14-bit lossless compressed.NEF
Software                        : ViewNX 2.0 M
    1 directories scanned
    5 image files read


Bad, bad software.

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

Alan Clifford

Quote from: Phil Harvey on February 03, 2014, 06:31:15 PM

Apparently ViewNX2 writes to the image when you just look at it:


Phil, that is not something I have been experiencing.

======== ./AHC_6325.NEF
Software                        : Ver.1.04
======== ./AHC_6325_cr.NEF
Software                        : ViewNX 2.8 M
======== ./AHC_6325_cr2.NEF
Software                        : ViewNX 2.8 M
======== ./AHC_6326.NEF
Software                        : Ver.1.04
======== ./AHC_6327.NEF
Software                        : Ver.1.04

Phil Harvey

Hi Alan,

That is useful information.  Maybe something else is happening then.  (I know it isn't me because I haven't run ViewNX.)

You two are running different versions of ViewNX though.  It's a long shot, but could this be the difference?

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

Alan Clifford

I wouldn't like to comment re: the versions.  But I've used that version with the D7000:

======== dsc_0108.nef
Software                        : Ver.1.00
======== dsc_0108_crop.nef
Software                        : ViewNX 2.0 M


kohnecamera

Hello, I am very novice when it comes to terminal commands on the mac. I am attempting to use this, but when i drag and drop the file(s) that i need to fix, i receive a permission denied error. I am the admin user, I've changed read and write permissions within the "get info" window, but still have this problem. Any help or ideas would be greatly appreciated!
Thanks

kohnecamera

Quote from: kohnecamera on March 11, 2014, 09:54:13 AM
Hello, I am very novice when it comes to terminal commands on the mac. I am attempting to use this, but when i drag and drop the file(s) that i need to fix, i receive a permission denied error. I am the admin user, I've changed read and write permissions within the "get info" window, but still have this problem. Any help or ideas would be greatly appreciated!
Thanks

I've fixed my own problem! As usual, one must read the instructions carefully before use. Thanks again for a great program!

didier

Hello Phil, iam new here from France.
I got problems with my RAW (NEF) files with my DF Nikon during transferring to my computer.
I will try with your application to restaure my files, i know that it works with the d800 and d4, d600.
Is it working with the new DF ? (df mix of d600 and the d4 captor)
Thanks a lot.
Didier.

Phil Harvey

Hi Didier,

No, it doesn't yet work with the DF.  To add support for this, I will need corrupted and uncorrupted images from each of the possible NEF formats written by this camera (all combinations of compression settings and NEF bit depth).  If you email the samples to me (philharvey66 at gmail.com) I will add support for this camera.

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

Cactus

Quote from: Phil Harvey on June 17, 2014, 11:22:26 AM
Hi Didier,

No, it doesn't yet work with the DF.  To add support for this, I will need corrupted and uncorrupted images from each of the possible NEF formats written by this camera (all combinations of compression settings and NEF bit depth).  If you email the samples to me (philharvey66 at gmail.com) I will add support for this camera.

- Phil

Hi Phil, hi Didier,

great success with D800 (thank very very much!) but the same problem with the Df. Would be really fine if exiftools would help.

Thanks again,
Peter

Phil Harvey

Hi Peter,

If you email me the samples, I will add support for this.  (It will take a few weeks though, because I am still technically on vacation now.)

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

kimequa

Phil,
I'm not sure if your software is what I need or not. I'm sure you'll know after I explain my problem.

I have the Nikon D7000 camera. I was unaware that I needed a specific compatible memory card, so I bought a cheapo one before my vacation. About half the photos (.nef) and videos (.mov) look great and the other half are corrupted and I cannot see them at all. I have already re-used the memory card a number of times since then (I was on vacation, so every day I uploaded them to my PC) ....but I DO have the corrupted nef files saved on my PC in hopes that I may one day find a fix.

Do you think it's possible to recover any of these using your software or something else?? I did try using your program, but I got an error that says "Not a D4, Df, D600, D610, D750, D800/D800E, D3200, D5200, or D7100 NEF"

Thank you for your help!!