You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Daniel Berger edited this page May 24, 2021
·
4 revisions
File.image?(file)
The File.image? method will return a boolean to indicate whether or not the file you've specified is an image or not.
For purposes of this library, an image is a file that is identified as a jpeg, gif, png, bmp, tiff or ico file. The implementation does a check against the first few bytes of the file as well as the file extension, though the latter can be disabled.
Specific Image Test Methods
Instead of checking for a generic image result, you can check for a specific type of image using the following methods: