You are here

function emthumb_validate_is_image in Embedded Media Field 6

Check that the file is recognized as an image. Will accept more image types than the standard file_validate_is_image();

Parameters

$file: A Drupal file object.

Return value

An array. If the file is not an image, it will contain an error message.

File

contrib/emthumb/emthumb.module, line 246
Allows for custom thumbnail overrides to Embedded Media Field.

Code

function emthumb_validate_is_image(&$file) {
  $errors = array();
  if (strpos($file->filemime, 'image') === FALSE) {
    $errors[] = t("The file you uploaded was not recognized as an image. Please upload a different image type.");
  }
  return $errors;
}