Can be used in web upload forms for detecting XSS or LFI attacks.
In Internet Explorer, the developer can successfully launch XSS attacks with malformed image files because of it's mime-type detection algorithm.
Also the image files can contain some server-side payloads that can be used on exploiting of LFI vulnerabilities.
To prevent this, the class checks if the image is valid, and after that it cleans the EXIF section.
It uses GD for these image operations and also doesn't leave the GD banner at the EXIF.