File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -67,13 +67,17 @@ public function __construct(
67
67
*
68
68
* @param AssetImage $imageAsset
69
69
* @return array
70
+ * @throws \Exception
70
71
*/
71
72
private function getImageSize (AssetImage $ imageAsset )
72
73
{
73
74
$ imagePath = $ imageAsset ->getPath ();
74
75
$ size = $ this ->sizeCache ->load ($ imagePath );
75
76
if (!$ size ) {
76
77
$ size = getimagesize ($ imagePath );
78
+ if (!$ size ) {
79
+ throw new \Exception ('An error occurred while reading file: ' . $ imagePath );
80
+ }
77
81
$ this ->sizeCache ->save ($ size [0 ], $ size [1 ], $ imagePath );
78
82
$ size = ['width ' => $ size [0 ], 'height ' => $ size [1 ]];
79
83
}
Original file line number Diff line number Diff line change @@ -26,8 +26,7 @@ class SizeCache
26
26
27
27
public function __construct (
28
28
CacheInterface $ cacheManager
29
- )
30
- {
29
+ ) {
31
30
$ this ->cacheManager = $ cacheManager ;
32
31
}
33
32
You can’t perform that action at this time.
0 commit comments