How do I programmatically check whether an image (PNG, JPEG, or GIF) is corrupted?

前端 未结 5 1733
你的背包
你的背包 2020-12-13 10:40

Okay. So I have about 250,000 high resolution images. What I want to do is go through all of them and find ones that are corrupted. If you know what 4scrape is, then you kno

5条回答
  •  粉色の甜心
    2020-12-13 10:53

    You could use imagemagick if it is available:

    if you want to do a whole folder

    identify "./myfolder/*" >log.txt 2>&1
    

    if you want to just check a file:

    identify myfile.jpg
    

提交回复
热议问题