Is there any way to have PHP detect a corrupted image?

后端 未结 6 1021
余生分开走
余生分开走 2020-12-18 07:17

Is there any way to have PHP determine whether an image file is corrupted and will not be able to display properly?

I\'ve tried to check with fopen and

6条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-18 07:54

    This works for me 100% :) I test if image exists by file_exists() and if it exists, you will catch corrupted images with this.

    
    

提交回复
热议问题