private function isImage(FileInterface $file) {
    $image = $this->getImage($file);

    if ($image === NULL) {
      return FALSE;
    }

    return $image->isValid();
  }
private function isImage(FileInterface $file) {
    $image = $this->getImage($file);

    if ($image === NULL) {
      return FALSE;
    }

    return $image->isValid();
  }
private function isImage ( FileInterface $ file ) { $ image = $ this -> getImage ( $ file ) ; if ( $ image === NULL ) { return FALSE ; } return $ image -> isValid ( ) ; }
Check if its a file or image so we know what to render.

@param \Drupal\file\FileInterface $file
A file entity. This function may resize the file affecting its size.

@return bool
TRUE when it's an image and not a file
Check if its a file or image so we know what to render .