mirror of
https://github.com/Intervention/image.git
synced 2025-08-26 15:24:37 +02:00
[FIX] File name is longer than the maximum allowed path length in some OS
This commit is contained in:
@@ -186,7 +186,11 @@ abstract class AbstractDecoder
|
|||||||
public function isFilePath()
|
public function isFilePath()
|
||||||
{
|
{
|
||||||
if (is_string($this->data)) {
|
if (is_string($this->data)) {
|
||||||
|
try {
|
||||||
return is_file($this->data);
|
return is_file($this->data);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -322,15 +326,15 @@ abstract class AbstractDecoder
|
|||||||
case $this->isStream():
|
case $this->isStream():
|
||||||
return $this->initFromStream($this->data);
|
return $this->initFromStream($this->data);
|
||||||
|
|
||||||
case $this->isFilePath():
|
|
||||||
return $this->initFromPath($this->data);
|
|
||||||
|
|
||||||
case $this->isDataUrl():
|
case $this->isDataUrl():
|
||||||
return $this->initFromBinary($this->decodeDataUrl($this->data));
|
return $this->initFromBinary($this->decodeDataUrl($this->data));
|
||||||
|
|
||||||
case $this->isBase64():
|
case $this->isBase64():
|
||||||
return $this->initFromBinary(base64_decode($this->data));
|
return $this->initFromBinary(base64_decode($this->data));
|
||||||
|
|
||||||
|
case $this->isFilePath():
|
||||||
|
return $this->initFromPath($this->data);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
throw new Exception\NotReadableException("Image source not readable");
|
throw new Exception\NotReadableException("Image source not readable");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user