File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212namespace Liip \ImagineBundle \Binary \Loader ;
1313
1414use Liip \ImagineBundle \Binary \Locator \LocatorInterface ;
15+ use Liip \ImagineBundle \Exception \Binary \Loader \NotLoadableException ;
1516use Liip \ImagineBundle \Exception \InvalidArgumentException ;
1617use Liip \ImagineBundle \Model \FileBinary ;
1718use Symfony \Component \HttpFoundation \File \MimeType \ExtensionGuesserInterface as DeprecatedExtensionGuesserInterface ;
@@ -69,6 +70,11 @@ public function __construct(
6970 public function find ($ path )
7071 {
7172 $ path = $ this ->locator ->locate ($ path );
73+
74+ if (\is_file ($ path ) === false ) {
75+ throw new NotLoadableException (\sprintf ('Source image: "%s" is no file. ' , $ path ));
76+ }
77+
7278 $ mimeType = $ this ->mimeTypeGuesser instanceof DeprecatedMimeTypeGuesserInterface ? $ this ->mimeTypeGuesser ->guess ($ path ) : $ this ->mimeTypeGuesser ->guessMimeType ($ path );
7379 $ extension = $ this ->getExtension ($ mimeType );
7480
You can’t perform that action at this time.
0 commit comments