File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,11 @@ public static function forMissingImage()
1010 return new static (lang ('Images.sourceImageRequired ' ));
1111 }
1212
13+ public static function forFileNotSupported ()
14+ {
15+ return new static (lang ('Images.fileNotSupported ' ));
16+ }
17+
1318 public static function forMissingAngle ()
1419 {
1520 return new static (lang ('Images.rotationAngleRequired ' ));
Original file line number Diff line number Diff line change @@ -242,7 +242,7 @@ protected function image(): ?Image
242242 // File::__construct has verified the file exists - make sure it is an image
243243 if (! is_int ($ this ->image ->imageType ))
244244 {
245- throw ImageException::forInvalidPath ();
245+ throw ImageException::forFileNotSupported ();
246246 }
247247
248248 // Note that the image has been verified
Original file line number Diff line number Diff line change @@ -137,7 +137,11 @@ public function getProperties(bool $return = false)
137137 {
138138 $ path = $ this ->getPathname ();
139139
140- $ vals = getimagesize ($ path );
140+ if (! $ vals = getimagesize ($ path ))
141+ {
142+ throw ImageException::forFileNotSupported ();
143+ }
144+
141145 $ types = [
142146 1 => 'gif ' ,
143147 2 => 'jpeg ' ,
Original file line number Diff line number Diff line change 2121 'gifNotSupported ' => 'GIF images are often not supported due to licensing restrictions. You may have to use JPG or PNG images instead. ' ,
2222 'jpgNotSupported ' => 'JPG images are not supported. ' ,
2323 'pngNotSupported ' => 'PNG images are not supported. ' ,
24+ 'fileNotSupported ' => 'The supplied file is not a supported image type. ' ,
2425 'unsupportedImageCreate ' => 'Your server does not support the GD function required to process this type of image. ' ,
2526 'jpgOrPngRequired ' => 'The image resize protocol specified in your preferences only works with JPEG or PNG image types. ' ,
2627 'rotateUnsupported ' => 'Image rotation does not appear to be supported by your server. ' ,
You can’t perform that action at this time.
0 commit comments