![]() |
media type in the manifest
Hi,
how does Sigil determine the media type of fonts in the manifest? Checking the code often brings up wrong media types like octet-stream, but unfortunetly there is no way of correcting this in an efficient way. I need to type it in or do a search and replace. //rubeus |
It uses the media-type provided by the incoming manifest or alternatively the file extension (.ttf, .otf, etc) via a short lookup dictionary when the font is first selected/imported.
|
Thx, may it be possible to post the mapping table?
|
Here is the link:
https://github.com/user-none/Sigil/b...PFResource.cpp At the very bottom of this file you will find a mapping table. The plugin uses its own version of this and they may not be fully in sync but they are close. In a plugin launcher code there is a easy way to get the media-type if you provide the basename of the file with extension. It also provides the media-type for every font file. So the plugin should already easily be able to supply you with the media-type for any file existing in the epub that has an entry in the manifest. KevinH |
Thanks so far. What i'm looking for is something to change the media-type if flightcrew is complaining against "wrong" ones. Flightcrew complains, but there is no way of fixing that except manual work.
I think there is no reader/app available which will not work properly if the media type is weird, but i like to have an error reporting clean instead of deciding all the time if an error can be ignored or not. |
Quote:
|
As far as i know epubcheck requires Java. I dont have this and will not install it. Too many security holes in Java, just like Flash.
|
Quote:
But don't rely on FlightCrew. It's just not good enough. |
You can install Java and still disable usage from the browser.
|
There is no need to deactivate something if you install the server version of Java. There are no plugins, no install activities, just a bunch of files to be stored somewhere.
But this is not the point. Flightcrew is throwing some errors which i want to handle more efficiently. Thats why i asked how Sigil is determining the needed media-type. |
Please post the current manifest entry and the error message from flightcrew
KevinH |
Well, Flightcrew is complaining that application/octet-stream is not a valid mesia type and should be application/vnd.ms-opentype
Thats correct cause in the manifest it is octet-stream. Now i have to go to the content.opf hand need to change it manually. There is no way to copy the correct media type out of the error window to paste it in nor any other way of double clicking right clicking. I'm looking for a way to simplify this as Sigil/Flightcrew does know what the caorrect value is but offers nothing to correct it. |
What font are you adding? I can't remember seeing octet-stream as media type while adding fonts.
|
1 Attachment(s)
You could automate mimetype replacements with Saved Searches:
|
Quote:
@OP: I'd suggest a plugin that checks font-file extensions and then finds the corresponding opf manifest entry and adjusts the mimetype if necessary. You could probably incorporate it into your Clean OPF plugin. |
| All times are GMT -4. The time now is 08:30 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.