diff --git a/src/Intervention/Image/AbstractDecoder.php b/src/Intervention/Image/AbstractDecoder.php index 9adc57f9..c421c7d9 100644 --- a/src/Intervention/Image/AbstractDecoder.php +++ b/src/Intervention/Image/AbstractDecoder.php @@ -186,7 +186,11 @@ abstract class AbstractDecoder public function isFilePath() { if (is_string($this->data)) { - return is_file($this->data); + try { + return is_file($this->data); + } catch (\Exception $e) { + return false; + } } return false; @@ -322,15 +326,15 @@ abstract class AbstractDecoder case $this->isStream(): return $this->initFromStream($this->data); - case $this->isFilePath(): - return $this->initFromPath($this->data); - case $this->isDataUrl(): return $this->initFromBinary($this->decodeDataUrl($this->data)); case $this->isBase64(): return $this->initFromBinary(base64_decode($this->data)); + case $this->isFilePath(): + return $this->initFromPath($this->data); + default: throw new Exception\NotReadableException("Image source not readable"); }