Created
February 13, 2018 14:30
-
-
Save init90/b52a60499eef37e0258a62d22e3932dc to your computer and use it in GitHub Desktop.
Drupal 8, check if image is valid.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$image_factory = \Drupal::service('image.factory'); | |
$image = $image_factory->get($file->getFileUri()); | |
if (!$image->isValid()) { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment