Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 562228b

Browse files
fix for 7.1
1 parent b5dce66 commit 562228b

File tree

2 files changed

+5
-21
lines changed

2 files changed

+5
-21
lines changed

‎.travis.yml‎

Lines changed: 0 additions & 19 deletions
This file was deleted.

‎lib/ImageResize.php‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,16 @@ public function __construct($filename)
111111

112112
$finfo = finfo_open(FILEINFO_MIME_TYPE);
113113
$checkWebp = false;
114-
if (strstr(finfo_file($finfo, $filename), 'image') === false || version_compare(PHP_VERSION, '7.1.0', '<')) {
115-
if (strstr(file_get_contents($filename), 'WEBPVP8') !== false) {
114+
if (strstr(finfo_file($finfo, $filename), 'image') === false) {
115+
if (version_compare(PHP_VERSION, '7.0.0', '<=') && strstr(file_get_contents($filename), 'WEBPVP8') !== false) {
116116
$checkWebp = true;
117117
$this->source_type = IMAGETYPE_WEBP;
118118
} else {
119119
throw new ImageResizeException('Unsupported file type');
120120
}
121+
} elseif(strstr(finfo_file($finfo, $filename), 'image/webp')) {
122+
$checkWebp = true;
123+
$this->source_type = IMAGETYPE_WEBP;
121124
}
122125

123126
if (!$image_info = getimagesize($filename, $this->source_info)) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /