Is there a way to find if an image file is corrupt? I mean i can scan a folder and create an image listing, but can I , using php, find if an image is corrupt without echo/print the image source file on screen?
Thanks
dreamcatcher
7:38 am on Mar 28, 2006 (gmt 0)
I doubt its possible to detect a corrupt image omoutop. If you know the correct file size of the image, you can compare that to see if its correct. The file_exists() function will only detect whether the image exists or not, so as far as I know, only comparing the file size gives you a slight clue as to whether the image is ok or not.
dc
omoutop
8:08 am on Mar 28, 2006 (gmt 0)
I thought it might be impossible. I google for this for more than 1 hour and i found nothing. Thought i give it a try here.
Of course it's impossible for me to know the original file size of the images (unless i save it to db during upload process - which is tooooo late now).
Anyway, thanks for confirmation on an impossible task :)