Fix content type on webp

This commit is contained in:
Mike Primm 2022-02-03 15:24:37 -06:00
parent 8efdbed0b4
commit 26a987c98d
4 changed files with 8 additions and 0 deletions

View File

@ -88,6 +88,8 @@ $stmt->bind_result($tnewimage, $timage, $format, $thash, $tlast);
if ($stmt->fetch()) {
if ($format == 0) {
header('Content-Type: image/png');
} else if ($format == 2) {
header('Content-Type: image/webp');
} else {
header('Content-Type: image/jpeg');
}

View File

@ -93,6 +93,8 @@ list($timage, $format, $thash, $tlast) = $stmt->fetch();
if ($res && $timage) {
if ($format == 0) {
header('Content-Type: image/png');
} else if ($format == 2) {
header('Content-Type: image/webp');
} else {
header('Content-Type: image/jpeg');
}

View File

@ -89,6 +89,8 @@ if (isset($row[1])) {
$format = $row[1];
if ($format == 0) {
header('Content-Type: image/png');
} else if ($format == 2) {
header('Content-Type: image/webp');
} else {
header('Content-Type: image/jpeg');
}

View File

@ -74,6 +74,8 @@ if (strstr($path, ".png")) {
header("Content-Type: image/png");
} elseif (strstr($path, ".jpg")) {
header("Content-Type: image/jpeg");
} elseif (strstr($path, ".webp")) {
header("Content-Type: image/webp");
} else {
header("Content-Type: application/text");
}