1
0
mirror of https://github.com/Intervention/image.git synced 2025-09-02 10:23:29 +02:00

Merge pull request #709 from flipboxstudio/master

[FIX] File name is longer than the maximum allowed path length in some OS
This commit is contained in:
Oliver Vogel
2017-04-22 16:47:21 +02:00
committed by GitHub

View File

@@ -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");
}