You are here

public static function Utils::isImage in N1ED - Visual editor as CKEditor plugin with Bootstrap support 8.2

Is file an image.

3 calls to Utils::isImage()
AFile::isImage in src/Flmngr/FileUploaderServer/lib/file/AFile.php
Checks file is image or not.
FileUploaded::checkForErrors in src/Flmngr/FileUploaderServer/lib/file/FileUploaded.php
Returns do we need to continue check or not.
FileUploadedQuick::checkForErrors in src/Flmngr/FileUploaderServer/lib/file/FileUploadedQuick.php
Returns do we need to continue check or not.

File

src/Flmngr/FileUploaderServer/lib/file/Utils.php, line 92

Class

Utils
Utilites for uploader.

Namespace

Drupal\n1ed\Flmngr\FileUploaderServer\lib\file

Code

public static function isImage($name) {
  $exts = [
    "gif",
    "jpg",
    "jpeg",
    "png",
  ];
  $ext = Utils::getExt($name);
  for ($i = 0; $i < count($exts); $i++) {
    if ($exts[$i] === strtolower($ext)) {
      return TRUE;
    }
  }
  return FALSE;
}