Skip to content

Commit 791289e

Browse files
author
Mitch
committed
Suppress warning from getimagesize() when bad file provided, as we throw an exception later
1 parent a07134c commit 791289e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ImageResize.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,10 @@ public function loadFromString($imagedata)
129129
*/
130130
public function loadFromFile($filename)
131131
{
132-
$image_info = getimagesize($filename);
132+
$image_info = @getimagesize($filename);
133133

134134
if (!$image_info) {
135-
throw new \Exception('Could not read ' . $filename);
135+
throw new \Exception('Could not read ' . ($filename ?: 'file'));
136136
}
137137

138138
list (

0 commit comments

Comments
 (0)