Issue #1769 - Part 2: Implement JPEG-XL decoder and about:config and MIME plumbing.

Backported from Mozilla bug 1707590 whereever possible.
This commit is contained in:
Job Bautista 2022-06-19 15:40:33 +08:00 committed by roytam1
commit 51ea0e4f3a
15 changed files with 257 additions and 4 deletions

View file

@ -2550,6 +2550,12 @@ imgLoader::GetMimeTypeFromContent(const char* aContents,
!memcmp(aContents + 8, "WEBP", 4)) {
aContentType.AssignLiteral(IMAGE_WEBP);
} else if ((aLength >= 2 && !memcmp(aContents, "\xFF\x0A", 2)) ||
(aLength >= 12 &&
!memcmp(aContents, "\x00\x00\x00\x0CJXL \x0D\x0A\x87\x0A", 12))) {
// Each version is for containerless and containerful files respectively.
aContentType.AssignLiteral(IMAGE_JXL);
} else {
/* none of the above? I give up */
return NS_ERROR_NOT_AVAILABLE;