You are here

function imagefield_file_is_image in ImageField 6.3

Simple utility function to check if a file is an image.

1 call to imagefield_file_is_image()
imagefield_file_delete in ./imagefield_file.inc
Implementation of hook_file_delete().

File

./imagefield_file.inc, line 53
hook_file and imagefield file functions.

Code

function imagefield_file_is_image($file) {
  $file = (object) $file;
  return in_array($file->filemime, array(
    'image/jpg',
    'image/pjpeg',
    'image/jpeg',
    'image/png',
    'image/gif',
  ));
}