protected function TinyPngImageHandler::checkFile in TinyPNG 8
Check if given file entity is an image with a supported type.
Parameters
\Drupal\file\FileInterface $file: File entity to check.
Return value
bool Returns TRUE if given file is an image with supported type.
1 call to TinyPngImageHandler::checkFile()
- TinyPngImageHandler::shouldHandleEntity in src/
TinyPngImageHandler.php - Checks if we should handle entity.
File
- src/
TinyPngImageHandler.php, line 173
Class
- TinyPngImageHandler
- Class TinyPngImageHandler.
Namespace
Drupal\tinypngCode
protected function checkFile(FileInterface $file) {
return $this
->isImage($file) && $this
->isMimeSupported($file
->getMimeType());
}