Currently we call getimagesize() to determine if a file is a valid image, but as per #908282: Remove unnecessary I/O from theme_image() this can be an I/O problem for some server environments for image-heavy sites.
Being able to differentiate between a file that is an image and a file that isn't an image is good for this module being able to do it's job of not letting non-image URIs through to the browser. Causing further problems for developers who are already having a hard time with their file system is a bad thing :(
I'm thinking this can be approached in two ways:
- Use a less resource intensive function to test images like exif_imagetype if/when it is available on the server
- Provide a setting on the admin pages to disable verifying that discovered files are really images
Comments
Comment #1
thedavidmeister commentedNo longer want to use exif_imagetype as we're now actively leveraging the image size for other functionality.
The rest of this ticket is now a duplicate of #1757310: Option to cache results of uri validation functions and #1776548: Option to always send height/width of image to theme function..