Commit 31b25d03 authored by Wan-Teh Chang's avatar Wan-Teh Chang Committed by Commit Bot

Add an entry for image/avif to kPrimaryMappings

This allows us to display an AVIF image in the browser using the file:
URL.

Bug: 1071484
Change-Id: Iea6524f848a7e74b07005a0bedf2ea3a1320807f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2153331Reviewed-by: default avatarRyan Sleevi <rsleevi@chromium.org>
Commit-Queue: Wan-Teh Chang <wtc@google.com>
Cr-Commit-Position: refs/heads/master@{#760137}
parent 018d07c7
......@@ -160,6 +160,7 @@ static const MimeInfo kPrimaryMappings[] = {
{"audio/wav", "wav"},
{"audio/webm", "webm"},
{"audio/x-m4a", "m4a"},
{"image/avif", "avif"},
{"image/gif", "gif"},
{"image/jpeg", "jpeg,jpg"},
{"image/png", "png"},
......@@ -530,31 +531,30 @@ namespace {
// From http://www.w3schools.com/media/media_mimeref.asp and
// http://plugindoc.mozdev.org/winmime.php
static const char* const kStandardImageTypes[] = {
"image/bmp",
"image/cis-cod",
"image/gif",
"image/ief",
"image/jpeg",
"image/webp",
"image/pict",
"image/pipeg",
"image/png",
"image/svg+xml",
"image/tiff",
"image/vnd.microsoft.icon",
"image/x-cmu-raster",
"image/x-cmx",
"image/x-icon",
"image/x-portable-anymap",
"image/x-portable-bitmap",
"image/x-portable-graymap",
"image/x-portable-pixmap",
"image/x-rgb",
"image/x-xbitmap",
"image/x-xpixmap",
"image/x-xwindowdump"
};
static const char* const kStandardImageTypes[] = {"image/avif",
"image/bmp",
"image/cis-cod",
"image/gif",
"image/ief",
"image/jpeg",
"image/webp",
"image/pict",
"image/pipeg",
"image/png",
"image/svg+xml",
"image/tiff",
"image/vnd.microsoft.icon",
"image/x-cmu-raster",
"image/x-cmx",
"image/x-icon",
"image/x-portable-anymap",
"image/x-portable-bitmap",
"image/x-portable-graymap",
"image/x-portable-pixmap",
"image/x-rgb",
"image/x-xbitmap",
"image/x-xpixmap",
"image/x-xwindowdump"};
static const char* const kStandardAudioTypes[] = {
"audio/aac",
"audio/aiff",
......
......@@ -33,6 +33,7 @@ TEST(MimeUtilTest, ExtensionTest) {
{FILE_PATH_LITERAL("js"), "text/javascript", true},
{FILE_PATH_LITERAL("webm"), "video/webm", true},
{FILE_PATH_LITERAL("weba"), "audio/webm", true},
{FILE_PATH_LITERAL("avif"), "image/avif", true},
#if defined(OS_CHROMEOS)
// These are test cases for testing platform mime types on Chrome OS.
{FILE_PATH_LITERAL("epub"), "application/epub+zip", true},
......@@ -309,6 +310,7 @@ TEST(MimeUtilTest, TestGetExtensionsForMimeType) {
{"message/*", 1, "eml"},
{"MeSsAge/*", 1, "eml"},
{"message/", 0, nullptr, true},
{"image/avif", 1, "avif"},
{"image/bmp", 1, "bmp"},
{"video/*", 6, "mp4"},
{"video/*", 6, "mpeg"},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment