When a tree is found in all images jpeg, gif or png which are not, because a " good soul "was an unfortunate" mistake "during a file transfer that is wrong and that" good soul "in question did not bother to test his work ... Anyway so I want to detect all the images that are not.
First step, identify all files that end in gif, png and jpg:
mydirectory find /-regextype egrep-iregex '. + \\. (Png
This command will find me all files that have names that will end with a. Png or. Or a gi. Jpg.
Ok we have the list of all images remains to sort the wheat from the chaff for that I'll use the command
Identify the superb
Imagemagick
This powerful tool allows, among other to process images online command and it is only we will let Identify imagemagick detect if an image. If the image is not a mistake and we will be able to focus on these corrupt image files. Basically it gives:
mydirectory find /-regextype egrep-iregex '. + \\. (Png Identify 2> erreurs_images.txt
And voila! xargs is used to transmit the results of the previous command (the find) as argument to identify command and then with the STDERR redirection (2>) are harvested all errors in a file for processing.