06-18-2014, 02:54 PM | #796 |
Grand Sorcerer
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I'm still seeing a slight issue with AZW4/Print Replica in v0.72.
Line 454 (in processPrintReplica) of kindleunpack.py attempts to initiate the class OPFProcessor (mobi_opf.py) with an insufficient number of parameters. Should not OPFProcessor's 'pagemapxml' parameter be made optional? From (mobi_opf.py line 11): Code:
def __init__(self, files, metadata, filenames, imgnames, isNCX, mh, usedmap, pagemapxml, guidetext=False, k8resc=None): Code:
def __init__(self, files, metadata, filenames, imgnames, isNCX, mh, usedmap, pagemapxml='', guidetext=False, k8resc=None): I just have to figure out what to do about letting users select an apnx file from the plugin. I'm leaning toward not worrying about it at all. There's no way to store an apnx file WITH the book in calibre anyway, so I'm thinking of just leaving that as a feature they'll need to use the standalone version of KindleUnpack for. We'll see. Last edited by DiapDealer; 06-18-2014 at 03:03 PM. |
06-18-2014, 03:05 PM | #797 | |
Sigil Developer
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Hi DiapDealer,
Yes, most definitely. I made pagemapxml a null string in Mobi7 but this approach is better. I will make the change and release a 0.72a immediately. Hopefully the last bug! Edited: removed KindleUnpack_v072.zip and changed it to KindleUnpack_v072a.zip in previous post Yes, I would just leave out the apnx feature in the plugin. The apnx files generated by calibre even with the recent changes are mainly fake offsets which would just confuse the hell out of things for KindleUnpack. Also many of the apnx files in Kindle ebooks are just plain fake offsets as well. So yes, I would leave that for more advanced standalone use. Also, one question: Is there any real limit on image size or resolution in epubs? In other words, can we simply unpack the HDImages and replace the smaller kindlegen generated images on the fly. That will give the "best" image for later use in any conversion. If so, users can convert with an epub to epub conversion in Calibre if they need to downsample the images for their particular epub device. Thanks, KevinH Quote:
Last edited by KevinH; 06-18-2014 at 03:21 PM. Reason: Added Fact that v072a is now out |
|
06-18-2014, 03:20 PM | #798 |
Grand Sorcerer
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
I can understand the concern, but it's not really a question of "wanting" epub 3 support. (Mobi|Kindle)Unpack's goal has always been to try and recreate the original source material used to create the kindlebook as accurately as possible. The fact is ...kindlegen now accepts ePub 3 (and html5 and css3) as input for building kindlebooks. How silly (or presumptuous) would it be for KindleUnpack to attempt to force ePub 3 content into an ePub 2 box (without giving the user a choice to do so anyway)?
Last edited by DiapDealer; 06-18-2014 at 03:36 PM. |
06-18-2014, 03:36 PM | #799 | ||
Grand Sorcerer
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Quote:
"Use HD images whenever present?" I've come to realize that many use the KindleUnpack plugin precisely because they want to avoid having to do a calibre epub to epub conversion. |
||
06-18-2014, 04:23 PM | #800 | |
Resident Curmudgeon
Posts: 73,970
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
06-18-2014, 04:56 PM | #801 | |
Grand Sorcerer
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Regardless, I don't think I'm interested in populating user-defined calibre fields from externally selected and parsed apnx files. |
|
06-18-2014, 05:40 PM | #802 |
Grand Sorcerer
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
It certainly doesn't fall within KindleUnpack's purview, but it would be a nice-to-have feature to be able to generate an .apnx file with "real page numbers" from a KindleGen generated .mobi file with an embedded pagemap or pagelist since KindleGen wont generate one, and, AFAIK, Amazon won't generate .apnx files for KDP published books with pagemaps or pagelists either.
|
06-19-2014, 06:47 AM | #803 | ||||||||
Connoisseur
Posts: 94
Karma: 10
Join Date: Feb 2014
Location: Japan
Device: Kindle PaperWhite, Kobo Aura HD
|
Hi Kevin,
Quote:
Quote:
Quote:
Another, I am considering to make an option to converting to epub only and output no other files. Holding datalist and partlist might be helpful to do so, but not necessary if there are other ways. Quote:
Quote:
Quote:
Quote:
Quote:
It makes easer to switch the images in epub. I prefer to add an option to switch it by user. For conclusion, I am not stick to the code I have written, but please consider and give feedback to me about adding an option to convert to epub only though I do not plan to this immediately. And I would like to hear considerations from others too. Thanks, tkeo |
||||||||
06-19-2014, 09:50 AM | #804 | |||||||
Sigil Developer
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Quote:
Quote:
Quote:
Quote:
Why make two passes when one will do. Simply intelligently walk the sections once while writing images and fonts out as you go along (they will all be needed so no wasted space) and collecting any data that needs to be collected for later processing of ncx, nav, opf, xhtml,etc [/QUOTE] Quote:
Quote:
Also, please remove all of the flags you pass in for epub version support. It just means passing around flag bits that no one else will follow. The Tk GUI calls unpackBook directly, and should not need to build up flags. Simply pass in one character based option --epub_version= and use 2 or 3 or A as desired, default to 2 if nothing is passed in but please do not make a flags field, it just makes the code unreadable. Quote:
Also, it is not a general epub creator as we can only guarantee an epub-like structure and not a valid epub2 or even 3 depending on just what was passed into kindlegen in the first place. Take care, KevinH Last edited by KevinH; 06-19-2014 at 01:36 PM. Reason: fixed typos |
|||||||
06-19-2014, 12:43 PM | #805 | |
Sigil Developer
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Hi,
Given how very close APNX files and PAGE sections are, it should be easy to create a very short program to extract and covert a Mobi 8 PAGE section (which kindlegen generated from the input epub pageMap) into a standalone APNX file. It remains to be seen if this would work or not but it could be as simple as dumping the PAGE section after removing the first 8 bytes. When I get a free moment I will look into this to give you something to test with. At the very least it can easily provide page names and offsets to code that already knows how to generate an APNX. But unfortunately, none of the current APNX generating code groks the use of multiple page naming schemes used in the same document as our unpack code does. KevinH Quote:
Last edited by KevinH; 06-19-2014 at 12:48 PM. Reason: expanded on my answer |
|
06-20-2014, 08:54 AM | #806 | |
Connoisseur
Posts: 94
Karma: 10
Join Date: Feb 2014
Location: Japan
Device: Kindle PaperWhite, Kobo Aura HD
|
Hi Kevin,
Thank you for replying to my dim opinions. I understand why converting only to epub is not acceptable. I will modify the code based on your suggestions. Quote:
Thanks, Last edited by tkeo; 06-20-2014 at 08:56 AM. Reason: fixed typo. |
|
06-20-2014, 06:42 PM | #807 | ||
Sigil Developer
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Hi tkeo,
Quote:
Quote:
If you want, I would be happy to handle adding the command line switch to use HDImages if available and handle overwriting the Image files into the proper place and name in the mobi8 tree. That way you can focus on the epub3 changes. Take care and thanks for all of your hard work!! KevinH |
||
06-22-2014, 10:59 AM | #808 |
Connoisseur
Posts: 94
Karma: 10
Join Date: Feb 2014
Location: Japan
Device: Kindle PaperWhite, Kobo Aura HD
|
KindleUnpack v0.72b, the preview version for epub3 suport
Hi All,
Here is the preview version of epub3 supported KindleUnpack, v0.72b. Most RESC processing in kindleunpack.py is offloaded to mobi_resc.py (still remained a little bit needed for cover creation). Although I have tested, it might have bugs since I have modified a large amount of code. This version has three building manifest functions (for mobi7/azw4, for epub2 and for epub3) in order to make further support of epub3 less affect others; however, I think it is possible to use an unified function. Thanks, |
06-23-2014, 02:02 PM | #809 | |
Sigil Developer
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Hi tkeo,
Nicely done! Thank you! Once we get enough "its working" or by lack of "bug reports" please release it here as an official KindleUnpack_v073 version! Take care, Kevin Quote:
|
|
06-24-2014, 03:53 PM | #810 |
Sigil Developer
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Testers for APNX generation Needed?
Hi All,
I have a new experimental version of KindleUnpack that has all of tkeo's latest changes for epub3 support and that will generate an apnx file if the mobi passed in has a PAGE section. So if have an epub that has either a pagelist in the ncx or a page-map.xml, and you pass it into kindlegen, kindlegen will create a mobi with a PAGE section. If you then pass that mobi into KindleUnpack, and split it, you should now find a: - mobi7-BOOKFILENAME.mobi - mobi7-BOOKFILENAME.apnx - mobi8-BOOKFILENAME.azw3 - mobi8-BOOKFILENAME.apnx all in the unpacked output directory. I don't have access to an actual Kindle, but I am hoping if you side load either version and its associated apnx, you should see actual page numbers that exactly match what what was provided in the original epub. So if anyone has an actual Kindle they can test with and an epub with real page numbers in either the pagelist in the ncx or a separate page-map.xml file, I would love to have help debugging the apnx generation and getting it to actually work. Please let me know if you are willing to help and I will upload the experimental version of KindleUnpack for you to try. Thanks, KevinH PS: FWIW, it works perfectly with my Kindle.app on my Mac OS X machine. Page numbers show up just fine when I move the .azw3 and its .apnx into "My Kindle Content" folder. So I would love to know if this works for standalone Kindles and other Kindle apps. Last edited by KevinH; 06-24-2014 at 04:51 PM. Reason: adding more |
|
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 |