mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2025-01-13 05:31:44 +00:00
Return "application/x-truetype-font" for TrueType font MIME type recognition
Fix for bug 682.
This commit is contained in:
parent
28087bcb58
commit
2813d12ae9
@ -1,3 +1,9 @@
|
||||
2011-12-18 Moritz Bunkus <moritz@bunkus.org>
|
||||
|
||||
* mkvmerge, mmg: bug fix: Automatic MIME type recognition for
|
||||
TrueType fonts will result in "application/x-truetype-font" again
|
||||
instead of "application/x-font-ttf". Fix for bug 682.
|
||||
|
||||
2011-12-14 Andriy Bilous'ko <arestarh@ukr.net>
|
||||
|
||||
* documentation: enhancement: Added a Ukrainian translation for
|
||||
|
@ -2668,9 +2668,9 @@ guess_mime_type_by_content(magic_t &m,
|
||||
}
|
||||
#endif // HAVE_MAGIC_H
|
||||
|
||||
std::string
|
||||
guess_mime_type(std::string ext,
|
||||
bool is_file) {
|
||||
static std::string
|
||||
guess_mime_type_internal(std::string ext,
|
||||
bool is_file) {
|
||||
#if HAVE_MAGIC_H
|
||||
std::string ret;
|
||||
magic_t m;
|
||||
@ -2709,9 +2709,6 @@ guess_mime_type(std::string ext,
|
||||
if (ret == "application/octet-stream")
|
||||
ret = guess_mime_type_by_ext(ext);
|
||||
|
||||
if (ret == "")
|
||||
ret = "application/octet-stream";
|
||||
|
||||
return ret;
|
||||
}
|
||||
#else // HAVE_MAGIC_H
|
||||
@ -2719,6 +2716,20 @@ guess_mime_type(std::string ext,
|
||||
#endif // HAVE_MAGIC_H
|
||||
}
|
||||
|
||||
std::string
|
||||
guess_mime_type(std::string ext,
|
||||
bool is_file) {
|
||||
std::string mime_type = guess_mime_type_internal(ext, is_file);
|
||||
|
||||
if (mime_type.empty())
|
||||
return "application/octet-stream";
|
||||
|
||||
else if (mime_type == "application/x-font-ttf")
|
||||
return "application/x-truetype-font";
|
||||
|
||||
return mime_type;
|
||||
}
|
||||
|
||||
bool
|
||||
is_valid_cctld(const std::string &s) {
|
||||
int i;
|
||||
|
Loading…
Reference in New Issue
Block a user