I have >2000 images from a webcam stream (for a time-lapse video), I need to delete all incomplete & corrupted images, before passing them to a php-gd script that edits them for the final video.
Is it possible to detect corrupted files with imagemagick or some other tool? If i try to open the corrupted image with feh it displays libpng error: Read Error in console
Thanks in advance!
UPDATE: It seems that the suggested identify method accepts the bad images in my case. Here is an example of a corrupted one http://imgur.com/YcB9n
Try ImageMagick’s
identifycommand. From the man page:Example:
An alternative, is to use PIL (Python Imaging Library):
From the documentation: