1
0
mirror of https://github.com/Intervention/image.git synced 2025-08-25 23:06:13 +02:00

[FIX] File name is longer than the maximum allowed path length in some OS

This commit is contained in:
denmasyarikin
2017-04-02 02:07:11 +07:00
parent c9a162592d
commit 58881f0bc8

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