i need to verify a lot of images files for an application, the situations is that i have 10 directories with almost 10,000 images on each one, something like 100,000 files. Those files are supposed to be gif files but a lot of them (and really mean a lot) were jpg files that a designer change the extension from .jpg to .gif without converting the file format. This is causing the application crash, it creates pdf files using those images, and if i tell to the programm that use the file somefile.gif but it really is a jpg with the extension renamed the pdf creator crashes. I don't want to open every file in something like irfanview or photoshop to verify the format and then modify it if is necessary. Is there a library, class, plugin or something in php or another language that tell me the format of files with no base in the extension but in the headers of the file?
I can't find any ideas to do this, some one can help me?
Thanxs a lot in advance!!!
I personally use exif_imagetype for a true verification rather than checking extensions or mime types.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With