Skip to content

File.image?

Daniel Berger edited this page Aug 10, 2018 · 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 not check for file extensions, but rather does a check against the first few bytes of the file.

Clone this wiki locally