Skip to content

Commit ecad2ea

Browse files
committed
webp hack removed
1 parent b2f352e commit ecad2ea

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

lib/ImageResize.php

+1-12
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,7 @@ public function __construct($filename)
108108
}
109109

110110
$finfo = finfo_open(FILEINFO_MIME_TYPE);
111-
$checkWebp = false;
112-
if (strstr(finfo_file($finfo, $filename), 'image') === false) {
113-
if (version_compare(PHP_VERSION, '7.0.0', '<=') && strstr(file_get_contents($filename), 'WEBPVP8') !== false) {
114-
$checkWebp = true;
115-
$this->source_type = IMAGETYPE_WEBP;
116-
} else {
117-
throw new ImageResizeException('Unsupported file type');
118-
}
119-
} elseif(strstr(finfo_file($finfo, $filename), 'image/webp') !== false) {
120-
$checkWebp = true;
121-
$this->source_type = IMAGETYPE_WEBP;
122-
}
111+
123112

124113
if (!$image_info = getimagesize($filename, $this->source_info)) {
125114
$image_info = getimagesize($filename);

0 commit comments

Comments
 (0)