How to detect corrupt NEF, TIF or JPEG files

Started by ipunis, January 09, 2013, 06:23:45 PM

Previous topic - Next topic

ipunis

Hi there,

several month ago I had a problem with my hard drive and finally I have some of my photos back. There is problem that in folders that contains my photos there are some corrupted files. Sometime this is visible because thumbnail is not generated, but sometimes thumbnail is ok but when I try to view photo I can see that the file is corrupted. Is there any method that can rename files that are corrupted by adding prefix like "Corrupted_DSC2234.NEF". In the folders I have many files and viewing one by one will take a long time to finish :)

Thank you for reading :)

Phil Harvey

ExifTool isn't a verification tool, so I don't think it will help with what you want unless you get lucky and the corruption generates an ExifTool warning, but ExifTool deals with the metadata, not the image, and a warning about a metadata problem doesn't necessarily indicate a problem with the image, or visa versa.

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

ipunis

Thank you Phil, but do you know if there exist some piece o sw that can check integrity of NEF, TIF or JPEG file? I have seen that mostly  my corrupted image files are missing EXIF data is there a way that I can rename files that are missing EXIF? That will help me a lot. Thank you again.

Phil Harvey

You could do this:

exiftool -if 'not $exififd:all' '-filename<corrupt_$filename' DIR

(use single quotes as above in Mac/Linux or double quotes instead in Windows)

This will rename files with no ExifIFD tags.

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


sempervirentz

worked. And saved me a lot of time!
Thanks!