Skip to content

Commit 7391578

Browse files
committed
fixed error message
1 parent ddb3b73 commit 7391578

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

lib/ImageResize.php

+8-11
Original file line numberDiff line numberDiff line change
@@ -109,25 +109,22 @@ public function __construct($filename)
109109

110110
$finfo = finfo_open(FILEINFO_MIME_TYPE);
111111

112-
113112
if (!$image_info = getimagesize($filename, $this->source_info)) {
114113
$image_info = getimagesize($filename);
115114
}
116115

117-
if (!$checkWebp) {
118-
if (!$image_info) {
119-
if (strstr(finfo_file($finfo, $filename), 'image') !== false) {
120-
throw new ImageResizeException('Unsupported image type');
121-
}
122-
123-
throw new ImageResizeException('Could not read file');
116+
if (!$image_info) {
117+
if (strstr(finfo_file($finfo, $filename), 'image') !== false) {
118+
throw new ImageResizeException('Unsupported image type');
124119
}
125120

126-
$this->original_w = $image_info[0];
127-
$this->original_h = $image_info[1];
128-
$this->source_type = $image_info[2];
121+
throw new ImageResizeException('Unsupported file type');
129122
}
130123

124+
$this->original_w = $image_info[0];
125+
$this->original_h = $image_info[1];
126+
$this->source_type = $image_info[2];
127+
131128
switch ($this->source_type) {
132129
case IMAGETYPE_GIF:
133130
$this->source_image = imagecreatefromgif($filename);

0 commit comments

Comments
 (0)