Skip to content

Inconsistent mimetypes in zimcreatorfs.cpp #453

@ThisIsFineTM

Description

@ThisIsFineTM

zimcreatorfs.cpp has some hard coded mime type checks that otherwise don't exist in the mime type map in zimwriterfs/tools.cpp. I stumbled upon this when working on #444.

Code in question:

if (mimeType == "application/font-ttf"
|| mimeType == "application/font-woff"
|| mimeType == "application/font-woff2"
|| mimeType == "application/vnd.ms-opentype"
|| mimeType == "application/vnd.ms-fontobject") {

These mime types used in zimcreatorfs don't exist in the zimwriterfs/tools.cpp:extMimeTypes map:

"application/font-ttf"
"application/font-woff"
"application/font-woff2"
"application/vnd.ms-opentype"

These are the closest mimetypes in tools:

static std::map<std::string, std::string> _create_extMimeTypes()

extMimeTypes["ttf"] = "font/ttf";
extMimeTypes["woff"] = "font/woff";
extMimeTypes["woff2"] = "font/woff2";

How should this inconsistency be addressed, if at all? Just some cursory searches yielded:

https://stackoverflow.com/a/5130985
font/ttf and application/x-font-ttf

For "application/font-ttf" I found this:
jsdelivr/jsdelivr#1673

As for "application/vnd.ms-opentype", I found these:
w3c/epub-specs#443
jgm/pandoc#1761

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions