update v 1.0.7.5
This commit is contained in:
@@ -202,7 +202,7 @@ abstract class AbstractFont
|
||||
/**
|
||||
* Set path to font file
|
||||
*
|
||||
* @param string $align
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
public function file($file)
|
||||
|
@@ -25,18 +25,15 @@ class Decoder extends \Intervention\Image\AbstractDecoder
|
||||
// define core
|
||||
switch ($info[2]) {
|
||||
case IMAGETYPE_PNG:
|
||||
$core = imagecreatefrompng($path);
|
||||
$this->gdResourceToTruecolor($core);
|
||||
$core = @imagecreatefrompng($path);
|
||||
break;
|
||||
|
||||
case IMAGETYPE_JPEG:
|
||||
$core = imagecreatefromjpeg($path);
|
||||
$this->gdResourceToTruecolor($core);
|
||||
$core = @imagecreatefromjpeg($path);
|
||||
break;
|
||||
|
||||
case IMAGETYPE_GIF:
|
||||
$core = imagecreatefromgif($path);
|
||||
$this->gdResourceToTruecolor($core);
|
||||
$core = @imagecreatefromgif($path);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -45,6 +42,14 @@ class Decoder extends \Intervention\Image\AbstractDecoder
|
||||
);
|
||||
}
|
||||
|
||||
if ($core === false) {
|
||||
throw new \Intervention\Image\Exception\NotReadableException(
|
||||
"Unable to read image from file ({$path})."
|
||||
);
|
||||
}
|
||||
|
||||
$this->gdResourceToTruecolor($core);
|
||||
|
||||
// build image
|
||||
$image = $this->initFromGdResource($core);
|
||||
$image->mime = $info['mime'];
|
||||
|
@@ -34,7 +34,7 @@ class Driver extends \Intervention\Image\AbstractDriver
|
||||
{
|
||||
// create empty resource
|
||||
$core = imagecreatetruecolor($width, $height);
|
||||
$image = new \Intervention\Image\Image(new self, $core);
|
||||
$image = new \Intervention\Image\Image(new static, $core);
|
||||
|
||||
// set background color
|
||||
$background = new Color($background);
|
||||
|
@@ -2,7 +2,6 @@
|
||||
|
||||
namespace Intervention\Image;
|
||||
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class ImageServiceProvider extends ServiceProvider
|
||||
@@ -61,9 +60,9 @@ class ImageServiceProvider extends ServiceProvider
|
||||
*/
|
||||
private function getProvider()
|
||||
{
|
||||
if (get_class($this->app) == 'Laravel\Lumen\Application') {
|
||||
if ($this->app instanceof \Laravel\Lumen\Application) {
|
||||
$provider = '\Intervention\Image\ImageServiceProviderLumen';
|
||||
} elseif (version_compare(Application::VERSION, '5.0', '<')) {
|
||||
} elseif (version_compare(\Illuminate\Foundation\Application::VERSION, '5.0', '<')) {
|
||||
$provider = '\Intervention\Image\ImageServiceProviderLaravel4';
|
||||
} else {
|
||||
$provider = '\Intervention\Image\ImageServiceProviderLaravel5';
|
||||
|
@@ -23,7 +23,9 @@ class Decoder extends \Intervention\Image\AbstractDecoder
|
||||
|
||||
} catch (\ImagickException $e) {
|
||||
throw new \Intervention\Image\Exception\NotReadableException(
|
||||
"Unable to read image from path ({$path})."
|
||||
"Unable to read image from path ({$path}).",
|
||||
0,
|
||||
$e
|
||||
);
|
||||
}
|
||||
|
||||
@@ -81,7 +83,9 @@ class Decoder extends \Intervention\Image\AbstractDecoder
|
||||
|
||||
} catch (\ImagickException $e) {
|
||||
throw new \Intervention\Image\Exception\NotReadableException(
|
||||
"Unable to read image from binary data."
|
||||
"Unable to read image from binary data.",
|
||||
0,
|
||||
$e
|
||||
);
|
||||
}
|
||||
|
||||
|
@@ -42,7 +42,7 @@ class Driver extends \Intervention\Image\AbstractDriver
|
||||
$core->setColorspace(\Imagick::COLORSPACE_UNDEFINED);
|
||||
|
||||
// build image
|
||||
$image = new \Intervention\Image\Image(new self, $core);
|
||||
$image = new \Intervention\Image\Image(new static, $core);
|
||||
|
||||
return $image;
|
||||
}
|
||||
|
Reference in New Issue
Block a user