http://my.oschina.net/cart/
The picture grabbed to the local, grabbed the last 100,000 pictures, suddenly found that there are a few picture thumbnails to see is normal, open the picture straight display part, but the base is big ah, how to use PHP batch to detect which pictures damaged it?
If you want PHP to detect if the JPG image is damaged, is it complete? Please use:
Imagecreatefromjpeg
If you want PHP to detect if the GIF image is damaged, is it complete? Please use:
Imagecreatefromgif
If you want PHP to detect if the PNG image is damaged, is it complete? Please use:
Imagecreatefrompng
If you want PHP to detect if BMP image is damaged, is it complete ? Please use:
Imagecreatefrombmp
It's a bad test!
Others want to detect whether the picture is complete, whether the damage of the scheme such as:
- exif_read_data
- GetImageSize
- hexadecimal character recognition of the head or tail of the picture ...
- File_exists
- Is_file
And so are the clouds, there are compatibility issues! There's a part of it!
Resolute use of PHP image Corruption detection detects whether a picture is intact picture is damaged check whether the local picture is normal or not correct picture :
if (@imagecreatefromjpeg ($yourfile) = = False) { //image is bad....http://my.oschina.net/cart/}