05-19-2015, 01:42 AM | #1126 | |
Member
Posts: 16
Karma: 10
Join Date: Oct 2012
Device: Kindle 4
|
Quote:
Taking the source inside EPUB 3 FXL with linear cover.mobi as source:
Taking the source inside EPUB 3 FXL with no HTML cover.mobi as source:
Edit (2015-05-19T06:00:30Z): The source of EPUB 3 FXL with a linear HTML cover.mobi had some weird forgotten test CSS in cover_page.xhtml. It is irrelevant, but I still corrected and updated the attachment just in case. Last edited by elmimmo; 05-19-2015 at 02:07 AM. |
|
05-19-2015, 02:14 AM | #1127 | |
Member
Posts: 16
Karma: 10
Join Date: Oct 2012
Device: Kindle 4
|
Quote:
In the case above, the autogenerated cover_page.xhtml uses SVG markup, so its entry in the OPF manifest should have the attribute properties="svg" for it to be a valid EPUB 3. |
|
Advert | |
|
05-19-2015, 10:24 AM | #1128 | ||||||||||||||
Sigil Developer
Posts: 8,094
Karma: 5450184
Join Date: Nov 2009
Device: many
|
Hi,
Thanks for the detailed bug report. Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
In the future, when I have more time, I may add an option for keeping or removing all of that but right now I am more worried about correctness, not what any one person considers "cruft". Sorry about that. The real purpose of the KindleUnpack tool was to help reverse engineer current and future mobi changes. That is its primary role. It is not a "converter" per se. Quote:
Quote:
Quote:
Quote:
Please understand, KindleUnpack is not an epub2 or 3 converter. It is an unpacker that takes the compiled format of the azw3 and tries to create an epub-like structure to document what it finds and for people to later edit and fix. Quote:
Quote:
I'll pick back up commenting on the remainder when I get more time. Take care, KevinH |
||||||||||||||
05-19-2015, 12:50 PM | #1129 | ||||
Member
Posts: 16
Karma: 10
Join Date: Oct 2012
Device: Kindle 4
|
Let me first add that I just mentioned what I perceive as issues for obtaining a valid EPUB 3 out of a mobi. I understand not everything asked might align with the purpose of KindleUnpack, and I am fine with you tackling just some or none of the requests based on that. I appreciate that you consider them.
Quote:
Quote:
Code:
<meta name="fixed-layout" content="true" /> <meta name="orientation-lock" content="portrait" /> Code:
<meta property="rendition:layout">pre-paginated</meta> <meta property="rendition:orientation">portrait</meta> What bug was that? Quote:
The point of not outputting the playOrder attribute (which my source lacks too), which in turn requires not outputting the DOCTYPE as per the EPUB 2 spec, is to make post-editing of that file easier by avoiding its nasty requirement of it having to have consecutive values. Quote:
Again thanks for taking the time to consider my ideas. Last edited by elmimmo; 05-19-2015 at 01:24 PM. |
||||
05-19-2015, 01:19 PM | #1130 | ||
Sigil Developer
Posts: 8,094
Karma: 5450184
Join Date: Nov 2009
Device: many
|
Further response:
[QUOTE][*]My source OPF has <meta property="ibooks:binding">false</meta> in its metadata, which disables the fake spine shadow in iBooks and is innocuous in Kindle. If present, though, it is also required that the prefix attribute in the package declares the prefix ibooks: …. Kindle does not produce that fake shadow, so all the more reason to have KindleUnpack add that metadata to EPUB 3 FXL. The reasons for doing so are admittedly subjective, and the syntax is admittedly iBooks-only, i.e. non-standard, but it still does not make the EPUB 3 invalid and is not incompatible with Kindle. [QUOTE] Again, sorry but nothing ibooks specific that doesn't appear in the AZW3 raw source or metadata will be created during the unpack phase. Quote:
Quote:
That said, KindleUnpack should be adding the "svg" as a manifest property to correctly identify the use of svg in the cover image for an epub3. If it doesn't do that properly, it is a bug and something I will look into fixing. All in all I see 8 potential issues here: 1) if viewports meta exists in azw3, force conversion as epub3 2) add viewport metadata to each xhtml when viewport is found in azw3 metadata (if and only if kindlegen removes it when present in the input source) 3) properly setting the language metadata as specified in the azw3 header 4) adding metadata charset for xhtml docs (including nav) that matches the charset as specified in the azw3 header for epub3 5) adding the proper svg manifest property under epub3 for created cover images with svg 6) check / verify the proper prefixes for use with epub3 (ie. for epub 7) make sure opf: prefixes are removed from all dc metadata tags under epub3 8) make sure ncx meets valid daisy spec if present. KevinH |
||
Advert | |
|
05-19-2015, 01:37 PM | #1131 |
Member
Posts: 16
Karma: 10
Join Date: Oct 2012
Device: Kindle 4
|
Forgot to add (just for context; again I am fine if you think this is not in line with KindleUnpack's purpose) that while omitting the NCX DOCTYPE is optional in EPUB2, doing so is actually required in EPUB 3. Again, a DOCTYPE that my source lacks but KindleUnpack is adding when outputting to EPUB 3.
Last edited by elmimmo; 05-19-2015 at 01:39 PM. |
05-19-2015, 02:14 PM | #1132 | |
Sigil Developer
Posts: 8,094
Karma: 5450184
Join Date: Nov 2009
Device: many
|
HGi,
Actually no. epubcheck 3.X has a bug. An ncx under epub3 is allowed to have a DOCTYPE as it is required for fallback. This bug is fixed in epubcheck 4. So an proper daisy ncx with full doctype is allowed in epub3. Check the official epucheck 3.1 bug reports for details. KevinH Quote:
|
|
05-19-2015, 03:55 PM | #1133 | |
Member
Posts: 16
Karma: 10
Join Date: Oct 2012
Device: Kindle 4
|
Quote:
None of the EPUB 3 samples by the IDPF that have an NCX have its DOCTYPE in it, and there is no backwards compatibility issue as no ereader depends on its presence or its absence. |
|
05-19-2015, 05:39 PM | #1134 |
Sigil Developer
Posts: 8,094
Karma: 5450184
Join Date: Nov 2009
Device: many
|
Hi,
I was referring to this link: https://github.com/IDPF/epubcheck/issues/305 This issue is under review and of the last release of epubcheck 4 alpha having a DOCTYPE on a fallback ncx was considered acceptable. It seems someone disagrees with that on Apr 7, but I see no commit message or review to change epubcheck 4. So this one may get reversed yet again. In epubcheck 3 it was okay, in epubcheck 3.1 it was an error, and in epubcheck 4 alpha it was no longer an error. So I guess this is a wait and see. Either way KindleUnpack will keep the DOCTYPE on the ncx until epubcheck 4 final comes out and declares it one way or the other. |
05-20-2015, 11:02 AM | #1135 |
Member
Posts: 16
Karma: 10
Join Date: Oct 2012
Device: Kindle 4
|
With KindleUnpack v0.75, I could run KindleUnpack.py from the command line from any path (I used to create a symlink of kindleunpack.py and place it in my path).
With v0.80, I need to first have cd'd into KindleUnpack's lib folder and run it from there, like ./kindleunpack.py. Trying to run it from another path by calling kindleunpack.py with its full path (relative or absolute makes no difference) or by calling a symlink to kindleunpack.py that resides in my path, I get: Code:
Traceback (most recent call last): File "/Users/XXXX/bin/KindleUnpack/lib/kindleunpack.py", line 13, in <module> from .compatibility_utils import PY2, binary_type, utf8_str, unicode_str ImportError: No module named compatibility_utils The python version in my path is 2.7.9, installed with Homebrew on Mac OS 10.10.3. Last edited by elmimmo; 05-20-2015 at 11:07 AM. |
05-20-2015, 11:08 AM | #1136 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
I was playing with a setuptools-powered installer that might help on general principle...
When I get back to my computer I can post the patch. |
05-20-2015, 02:39 PM | #1137 | ||||
Sigil Developer
Posts: 8,094
Karma: 5450184
Join Date: Nov 2009
Device: many
|
Hi,
Here is a status update for those interested (using the very latest KindleUnpack v080. Quote:
Quote:
Quote:
Quote:
I will work on the remaining issues and let you know when I have something workable. Take care, KevinH Last edited by KevinH; 05-20-2015 at 03:54 PM. |
||||
05-20-2015, 03:36 PM | #1138 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Patch to add a setup.py
Because I prefer using entry points in /usr/bin/ |
05-21-2015, 09:43 AM | #1139 |
Sigil Developer
Posts: 8,094
Karma: 5450184
Join Date: Nov 2009
Device: many
|
Hi,
Here is a status update for those interested (using the very latest KindleUnpack v080). 1) if viewports meta exists in azw3, force conversion as epub3 . Actually the "fixed-layout" metadata is already detected and will set autodetection to generate an epub3. Simply use the switch --epub_version=A 2) add viewport metadata to each xhtml when viewport is found in azw3 metadata (if and only if kindlegen removes it when present in the input source) . As previously stated, kindlegen does not remove viewport meta in xhtml files so nothing needs to be done here for valid epub3 input -> valid epub3 output 3) properly setting the language metadata as specified in the azw3 . The fix for this was just committed to KindleUnpack master 4) adding metadata charset for xhtml docs (including nav) that matches the charset as specified in the azw3 header for epub3 . The fix for adding meta charset="UTF-8" to created nav under epub3 has been committed to KindleUnpack master 5) adding the proper svg manifest property under epub3 for created cover images with svg . TODO: This still needs to be fixed 6) check / verify the proper prefixes for use with epub3 (ie. for epub . The fix to add the proper epub3 xmlns declaration for nav has now been committed to KindleUnpack master. 7) make sure opf: prefixes are removed from all dc metadata tags under epub3 . The fix for this has now been committed to KindleUnpack Master 8) make sure ncx meets valid daisy spec if present. . TODO - I still need to figure out what is the correct set of information to show here under epub2 and epub3 Hope this helps, KevinH Last edited by KevinH; 05-21-2015 at 10:54 AM. |
05-22-2015, 01:36 PM | #1140 |
Sigil Developer
Posts: 8,094
Karma: 5450184
Join Date: Nov 2009
Device: many
|
Hi elmimmo,
It seems that kindlegen strips out all manifest properties completely from valid epub3 input. At least kindlegen does put spine properties in the k8 RESC section so that they are not lost. Therefore the only way to properly set any of the manifest properties for outputting an epub3 will be to literally parse every xhtml page looking for use of svg, math, and switch tags. This will require adding an xhtml parser to KindleUnpack because trying this with just "re" (regular expressions) while doable may lead to mistakes when pre tags, scripts, and use any of these special terms. So, if I have to parse and walk every xhtml file anyway, I should be able to detect if the original-resolution is present and if so add the meta viewport if not present. Basically, I am thinking of using the Sigil python plugin ePub3-itizer code and incorporate parts of it into KindleUnpack to properly set the DOCTYPE in each file while harvesting the use of svg, mathml, and epub:switch tags for use in the opf manifest creation. This will take some work but it should take care of your initial issue while fixing missing manifest properties in general for epub3. It is a shame that kindlegen does not keep them. KevinH Last edited by KevinH; 05-22-2015 at 01:45 PM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Can i rotate text and insert images in Mobi and EPUB? | JanGLi | Kindle Formats | 5 | 02-02-2013 04:16 PM |
PDF to Mobi with text and images | pocketsprocket | Kindle Formats | 7 | 05-21-2012 07:06 AM |
Mobi files - images | DWC | Introduce Yourself | 5 | 07-06-2011 01:43 AM |
pdf to mobi... creating images rather than text | Dumhed | Calibre | 5 | 11-06-2010 12:08 PM |
Transfer of images on text files | anirudh215 | 2 | 06-22-2009 09:28 AM |