News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

nikon D7000 nef corruped file from my camera

Started by daconews, May 04, 2018, 12:11:20 PM

Previous topic - Next topic

daconews

Hello thank you for this forum
i am a french photographer and your tools looks perfect
before I start in my camera i found 80 corrupted files
i send this link with 3 images

https://wetransfer.com/downloads/de076d10a1d86236e2c99ad900e410e920180504160554/69fc55e1fe1bd15d67cd54d8b610a10f20180504160556/407366

as you are more expert than me, can you tell me if you can fixe them with you tools ?
i will give you a donation and make the advert of you software in all the french countrie speaking  and i will translate you user guide for free
thanks for giving me an answer...
best regards

Phil Harvey

#1
I don't recall ever seeing this type of corruption before, but the files are perfectly salvageable.

The only problem is that there are four extra bytes at the start of the file that shouldn't be there.  If you remove these bytes, the file is fine.

I am attaching a simple Perl program I wrote that does this.  The command looks like this:

subfile _DSC6644.NEF _DSC6644_fixed.NEF 4

It works on a single file at a time, and requires Perl to run.

- Phil

P.S. I have given up translating the user guide to other languages because the translations can't keep up with the current version of the documentation.

Edit: Fixed subfile script to work when running on Windows, and added ability to process an entire directory.
...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 ($).

daconews

Hello
it's a very good news
How can i us it?
I have a windows 10
I download the file i place it in the folder of the picture
with CMD go to the folder and I type the command but the answer is "subfil" is not known as an intern command ....
I copy also the subfil on the window folder at the root and I type the command but the answer is the same "subfil" is not known as an intern command ....
sorry for my english
can you help me?
i work for university in France and i specialised in translation in spanish and portuges so I know how to have simple updated translation and I am going to translate your page for free
because your work is important for nikon lover's and photgraphy lovers like me and i think you also...



Phil Harvey

On Windows, you need to install Perl, then type "perl subfile ..." instead.  You can install ActivePerl for free from here.

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

daconews

Hello
this week end i install download and install perl from your link
I restard my computer and with CMD i go to the folder with the pictures
I strike the commande ligne
in CMD i have go the message "Done"
but the fixed file style are inreadable for Lightroom

can you tell me what i have down wrong or can i send you the picture and can you fixe them for me ?
here the link with the fixed file and the orginal files...

https://wetransfer.com/downloads/26cd6cc94930b67a4db5ce9c4a62bf2120180506070741/899c53fd2853d0a34df60e60044014ec20180506070741/9a4ad2

Its a relegious ceremony very special for a friend of mine as the children don't have a large life prosnotic
after i can take time to understand what i have done wrong
thanks a lot

Phil Harvey

When you tried the "subfile" utility, was the new file 4 bytes smaller than the old file?  If so, it should have worked with the files you sent me.  I don't know if all of your files were corrupted in the same way, but the ones you sent me were.

It would be a few days before I could download and convert all your files 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 ($).

daconews

Hello I try with the 3 files I send to you
DSC6644 19,135ko  the fixed 19,216 ko
DSC6645 18.062ko the fixed  18,062ko
DSC6646 17.933ko the fixed 18,004ko
do you have an Idea?
thank a lot for all you do for me...

Phil Harvey

OK.  Something went wrong with the subfile utility.  I'll fix them myself when I get a chance.

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

daconews

OK thanks you very much
as my link in wetransfert is only available one week
i can send it back to you when you want...
just give me a day...
there is 80 pictures corrupted
thank alot for you interest...

Phil Harvey

I found the problem.  My "subfile" script needed to open the files in binary mode when run on Windows.  I've updated the script to fix this, as well as fixing all of your files.  You can download the fixed versions here.

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

daconews

Hi It's Great
It work s can you send me the new script i will test it on my computer if you want
you are on MAC?
thank you very much
(now it's time for me to work!!!)
We stay in contact

Phil Harvey

I have updated the script attached to my previous post.  The script also now processes an entire directory of files with a command like this:

perl subfile SOURCEDIR DESTDIR 4

Yes, I'm on Mac.

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

daconews

Hello Phil
my name is also Philippe, but in french
I download the NEF files from your link and i can see them on my browser... no problem
but when i import it them to LightRoom their is a message "Fin de fichier inattendu " = 'inexpected end of file" i can just can see them
an its impossible to translet them to JPEG
do you have a solution?
thank one more time for you help, we are progressing on the way to fixe this problem...

Phil Harvey

You're right.  The raw data is missing 4 bytes.  Luckily it seems to work just adding 4 null bytes to the end of the file.  This is probably in the mask area so it may not affect the image at all.

Try this to see how it works for you:  I have added 4 null bytes to all of the files you sent.  You can download the fixed files here (fixed2.zip).

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

daconews

Hello
the link don't work...
message : "404 not found"

i start the translation of the web site :
Fix Corrupted Nikon NEF Images
Réparer des images NEF Nikon corrompues

Downloading NEF images from newer Nikon cameras with Nikon Transfer 1 or older versions of ViewNX 2 (and probably Capture NX 2) may result in corrupted NEF images that can no longer be opened.

L'utilisation de Nikon Transfert 1 ou d'anciennes versions ViewNX 2 (et probablement de Capture NX 2) pour télécharger des images faites par des appareil Nikon récents peut corrompre les images au format NEF et les rendre illisibles.
This utility repairs these corrupted NEF images for the D4, Df, D600, D610, D750, D800, D800E, D810, D850, D3200, D5200, D5300, D5500, D7100 and D7200.
Cet utilitaire répare ces images NEF corrompues pour le Nikon D4, Df, D600, D610, D750, D800, D800E, D810, D850, D3200, D5200, D5300, D5500, D7100 and D7200.

It DOES NOT REPAIR images corrupted by memory card problems, disk errors, or other software. [Nikon NX-D has also been known to corrupt images (possibly related to changing the file byte ordering!), but these problems are not fixed by this utility.]

Cet utilitaire ne répare pas les images corrompues par :
-   des problèmes de carte mémoire
-   des erreurs de disque dur
-   l'utilisation d'autres logiciels.
-   Nikon NX-D qui est connu pour corrompre les images (probablement en modifiant l'ordre des octets du fichier)


Warning! If you modify the corrupted images with any other software before fixing them with this utility, then the raw image data may be permanently lost! (This may happen for instance if you use View NX2 to geotag the images after downloading.)

Attention!  Ne modifiez surtout pas les images corrompues avec un autre logiciel avant de les réparer avec cet utilitaire car les données de l'image RAW peuvent être définitivement perdues! (Cela peut arriver si vous utilisez par exemple View NX2 pour géo taguer vos images après le téléchargement.)

Follow the instructions below for running this utility on Windows or Mac / Linux systems.
See this thread in the ExifTool forum if you have any questions or comments.
[Note that Nikon doesn't learn from their mistakes, and a similar problem happened 2 years earlier with an older version of Nikon Transfer and the D5000 (read here), and the new Nikon NX-D software has other corruption issues. The moral is: Don't use Nikon Transfer or any other utility that modifies the file to download your precious images!]

Conseil : N'utilisez pas Nikon Transfer ou tout autre utilitaire qui modifie le fichier pour télécharger vos précieuses images ! En effet si Nikon fait de très bon appareil pour la partie logiciel la firme japonaise a du mal à apprendre de ses erreurs comme le montre le problème déjà survenu par le passé avec une version plus ancienne de Nikon Transfer et le D5000 (lire l'article de 2010 ici), ou encore la sortie du logiciel Nikon NX-D qui pose d'autre soucis de corruption..

It is very sad that this Nikon software bug penalizes only loyal Nikon owners (since it affects only people who had an older copy of the Nikon software from a previous camera), yet Nikon customer support provides no help other than suggesting that you contact your memory card manufacturer to see if the original images can be restored.

Ces bugs logiciel pénalisent malheureusement les fidèles de la marque Nikon (ils ne concernent que les personnes ayant une vieille version du logiciel et ayant acheté un nouvelle appareil). Le SAV NIKON ne vous aide que s'il est possible de restaurer les photos sur la carte mémoire.



Phil Harvey

Sorry, there was a typo in the link.  I've fixed it here (fixed2.zip).

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

daconews

Hello Phil
the same problem (!) on the small image in Lightroom
but the message is different : "mistake appends while processing the picture"
any idea?...

daconews


Phil Harvey

OK, I can run LightRoom now, and can reproduce your observations.

Instead of adding 4 zero bytes, I took the last 4 bytes from a good D7000 NEF file and used those instead.  LightRoom now only has a problem with 8 out of your 81 files.  Here are the updated files (fixed3.zip).

I have also attached the script I used to add these bytes.

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

daconews

Hello Phil
I am back!!!
my Nikon D7000 make me the same problem after some month of good work...
I buy a new camera Nikon D7100

can you help me with this 85 pictures its a pack shoot i cant do it again ?
can you please fixe the problem of this files?

https://wetransfer.com/downloads/46913b9a93bf9a83464d3f27a980262f20181008214040/f7f4f4895151f1f80db0acb1decfe30420181008214040/e74934

it will be nice of you...
thanks a lot

Phil Harvey

This corruption was different.  There were also 2, 4 or 6 extra bytes added to the start of the files.

here are the fixed 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 ($).

daconews

Sorry Phil
I download your zip file
I can see the JPG small picture in LR but I have got an "unexpected end of file" with a "!" on the small images
it's look like the last problem a missing 4 bits or someting like that...
I am on windows 10
I hope you can fixe it
thanks a lot


Phil Harvey

I don't know why Photoshop doesn't like them, but I just tried converting them with Adobe DNG Converter 10.5 and they all converted to DNG without errors.  You should be able to use these DNG files in Photoshop.

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

daconews

thanks I am waiting for your ZIP...
thanks a lot...

Phil Harvey

You can download the Adobe DNG converter and do it yourself.

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

daconews

YES IT WORKS
YOU ARE SIMPLY THE BEST...
THANKS A LOT, A LOT, A LOT..