You are here

function mediafront_is_image in MediaFront 7

Same name and namespace in other branches
  1. 6.2 mediafront.module \mediafront_is_image()
  2. 6 mediafront.module \mediafront_is_image()

Checks to see if a file is an image file.

2 calls to mediafront_is_image()
mediafront_get_media_file in ./mediafront.module
Given a Drupal file object, this function returns the media player file object.
mediafront_get_media_preview in ./mediafront.module
Returns the image path for a media object.

File

./mediafront.module, line 648

Code

function mediafront_is_image($mimetype, $extension) {
  $image = in_array($extension, array(
    'jpg',
    'jpeg',
    'png',
    'gif',
  ));
  $image |= in_array($mimetype, array(
    'image/jpeg',
    'image/jpg',
    'image/png',
    'image/gif',
    'jpg',
    'jpeg',
    'png',
    'gif',
  ));
  return $image;
}