05-12-2015, 03:00 AM | #1 |
Banned
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
|
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 |
05-12-2015, 08:58 AM | #2 |
Sigil Developer
Posts: 7,654
Karma: 5433388
Join Date: Nov 2009
Device: many
|
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.
|
Advert | |
|
05-12-2015, 12:08 PM | #3 |
Banned
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
|
Thx, may it be possible to post the mapping table?
|
05-12-2015, 02:23 PM | #4 |
Sigil Developer
Posts: 7,654
Karma: 5433388
Join Date: Nov 2009
Device: many
|
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 |
05-13-2015, 01:49 AM | #5 |
Banned
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
|
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. |
Advert | |
|
05-13-2015, 04:51 AM | #6 | |
Resident Curmudgeon
Posts: 74,037
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
05-13-2015, 04:55 AM | #7 |
Banned
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
|
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.
|
05-13-2015, 04:58 AM | #8 | |
Resident Curmudgeon
Posts: 74,037
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
But don't rely on FlightCrew. It's just not good enough. |
|
05-13-2015, 06:01 AM | #9 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
You can install Java and still disable usage from the browser.
|
05-13-2015, 06:25 AM | #10 |
Banned
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
|
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. |
05-13-2015, 07:56 AM | #11 |
Sigil Developer
Posts: 7,654
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Please post the current manifest entry and the error message from flightcrew
KevinH |
05-13-2015, 08:13 AM | #12 |
Banned
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
|
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. |
05-13-2015, 11:37 AM | #13 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
What font are you adding? I can't remember seeing octet-stream as media type while adding fonts.
|
05-13-2015, 12:11 PM | #14 |
Grand Sorcerer
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
You could automate mimetype replacements with Saved Searches:
|
05-13-2015, 12:31 PM | #15 | |
Grand Sorcerer
Posts: 27,552
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
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. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Q: media-type for TrueType fonts? | phossler | Editor | 19 | 09-08-2023 11:06 PM |
Problem with detection/correction of media-type error | jackie_w | Editor | 2 | 01-04-2014 08:06 AM |
Buy vs licence in another media type | murraypaul | General Discussions | 15 | 06-11-2013 11:11 PM |
media-type | me too | ePub | 5 | 08-07-2012 05:32 PM |
Permissable Spine Media Type Error | mimosawind | ePub | 5 | 10-07-2011 03:55 AM |