Created
May 14, 2014 11:20
-
-
Save maxivak/57656bfe27b5115aa9a1 to your computer and use it in GitHub Desktop.
PHP. Check if image is corrupted
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$filaname = 'file.jpg'; | |
if (!@imagecreatefromjpeg($filename)){ | |
echo "bad image"; | |
} | |
else{ | |
echo 'ok'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment