1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 10:07:19 +00:00

Add support for webp, heic, and heif image formats

https://en.wikipedia.org/wiki/WebP
https://en.wikipedia.org/wiki/High_Efficiency_Image_File_Format
This commit is contained in:
Jermolene 2018-08-21 11:46:46 +01:00
parent 5756f30edd
commit 09112ed455
3 changed files with 9 additions and 0 deletions

View File

@ -1985,6 +1985,9 @@ $tw.boot.startup = function(options) {
$tw.utils.registerFileType("image/jpeg","base64",[".jpg",".jpeg"],{flags:["image"]}); $tw.utils.registerFileType("image/jpeg","base64",[".jpg",".jpeg"],{flags:["image"]});
$tw.utils.registerFileType("image/png","base64",".png",{flags:["image"]}); $tw.utils.registerFileType("image/png","base64",".png",{flags:["image"]});
$tw.utils.registerFileType("image/gif","base64",".gif",{flags:["image"]}); $tw.utils.registerFileType("image/gif","base64",".gif",{flags:["image"]});
$tw.utils.registerFileType("image/webp","base64",".webp",{flags:["image"]});
$tw.utils.registerFileType("image/heic","base64",".heic",{flags:["image"]});
$tw.utils.registerFileType("image/heif","base64",".heif",{flags:["image"]});
$tw.utils.registerFileType("image/svg+xml","utf8",".svg",{flags:["image"]}); $tw.utils.registerFileType("image/svg+xml","utf8",".svg",{flags:["image"]});
$tw.utils.registerFileType("image/x-icon","base64",".ico",{flags:["image"]}); $tw.utils.registerFileType("image/x-icon","base64",".ico",{flags:["image"]});
$tw.utils.registerFileType("application/font-woff","base64",".woff"); $tw.utils.registerFileType("application/font-woff","base64",".woff");

View File

@ -35,6 +35,9 @@ exports["image/jpg"] = ImageParser;
exports["image/jpeg"] = ImageParser; exports["image/jpeg"] = ImageParser;
exports["image/png"] = ImageParser; exports["image/png"] = ImageParser;
exports["image/gif"] = ImageParser; exports["image/gif"] = ImageParser;
exports["image/webp"] = ImageParser;
exports["image/heic"] = ImageParser;
exports["image/heif"] = ImageParser;
exports["image/x-icon"] = ImageParser; exports["image/x-icon"] = ImageParser;
})(); })();

View File

@ -1,6 +1,9 @@
title: $:/config/EditorTypeMappings/ title: $:/config/EditorTypeMappings/
image/gif: bitmap image/gif: bitmap
image/webp: bitmap
image/heic: bitmap
image/heif: bitmap
image/jpeg: bitmap image/jpeg: bitmap
image/jpg: bitmap image/jpg: bitmap
image/png: bitmap image/png: bitmap