Error in NEF files: is there an exiftool command to find these?

Started by ericconn, June 28, 2023, 09:40:53 AM

Previous topic - Next topic

ericconn

I have a large amount of files, some with errors from a bad disk or transfer, mixed in with the same files without errors, an example of which I've included. Is there an exiftool command to find these kinds of file errors? I couldn't get -efile to work, so help with that would be appreciate too. Thanks.


Phil Harvey

You included a JPG file but you say the problem is with NEF files.

Try running this command on one of the bad NEF files to see what ExifTool says:

exiftool -validate -warning -a FILE

About -efile -- what command did you use?

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

ericconn

Thanks. I included the just jpg as an example, here is a link to the actual file: NEF with error

I get the same output for both files with and without errors for the code you suggested:

Wrong IFD for 0x9003 DateTimeOriginal (should be ExifIFD not IFD0)

Here is the -efile I attempted. Let me restate that it's not that it didn't work, it gave me the readout of all the file attributes but I can't see an error, and it would be much easier as a CSV output:

exiftool -efile1 "C:\Test\Errors.csv" "C:\Test\Errors"
 

Phil Harvey

Right.  The command you gave would produce no output to the -efile1 file for the sample NEF file because it didn't generate any errors.

The image corruption issue is subtle and doesn't affect the rest of the file, so it doesn't cause an error with ExifTool.

Unfortunately there isn't a way to detect the raw data problem in your sample file using ExifTool.

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

ericconn

Thanks. I realized I could also extract the thumbnail and use an image comparison program I have, in case there's no solution from a direct exiftool command.

However, when using %f in Windows to extract the thumbnail and have the same filename, I end up with a filename of "f.tiff" for the thumbnail. Looking up in the documentation, it says to use %%f. I then get a file "%f.tiff".

exiftool -b -ThumbnailTIFF "C:\Errors\(filename).nef" "C:\Thumbnails\%%f.TIFF"

Phil Harvey

The command you posted is incomplete.  You need a -w before the output file format string:

exiftool -b -ThumbnailTIFF "C:\Errors\(filename).nef" -w "C:\Thumbnails\%f.TIFF"

(or %%f if you are running this from a .bat file)

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