![]() |
#811 | |
Connoisseur
![]() Posts: 94
Karma: 10
Join Date: Feb 2014
Location: Japan
Device: Kindle PaperWhite, Kobo Aura HD
|
Hi Kevin,
Quote:
And have you made GUI for epub3 support? If so, please upload it, I'd like to merge it. Thanks, |
|
![]() |
![]() |
![]() |
#812 | |||
Member
![]() Posts: 16
Karma: 10
Join Date: Oct 2012
Device: Kindle 4
|
In KF8 FXL comics, Kindlegen has always compressed images heavier than 800KB to something below that, but Amazon purportedly reports, according to the blog post Kindle Image File Size Increase Confirmed, that
Quote:
Quote:
Quote:
|
|||
![]() |
![]() |
![]() |
#813 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,793
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Experimental Version with APNX generation support, Improved GUI, and epub 3
Hi Testers,
Here is the very latest experimental version of KindleUnpack that should be able to generate APNX files if the mobi passed in has a PAGE section. It also has lots of GUI improvements from DiapDealer and experimental EPUB3 support from tkeo. Please let us know what if any problems you run into with any of these new features in this experimental release. Thanks, KevinH Quote:
|
|
![]() |
![]() |
![]() |
#814 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,793
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Hi tkeo,
Okay, that is a popular piece of code. I could not find the original site "draco.boskant.nl" anywhere online. Nor did a Google search of draco and boskant and nl turn up anything really. I did find an src.rpm from 2006 linked to by FileWatcher AltLinux. And then by searching altlinux repositories I finally found the Draco-0.99.4.tar.gz and downloaded it. And yes the routine in question came from image.py and was released under GPL version 2. Also, the Internet Archive WayBack Machine (web.archive.org) did archive the main page from http://draco.boskant.nl/ and it confirmed it was released under the GPL version 2 back in 2003 I believe. Also I did the following Google search: "Determine the image type of fhandle" and draco And I found that exact same code in at least 3 places all on github. - in Aveenstra/Images_To_ePub/_ePubMaker.py under the GPL 3 license - in evfredericksen/oodocx/oodocx/helper_functions.py under a BSD License - in SublimeText3-Packages/SideBarEnhancements/SideBar.py under a GPL (no version specified) license I also found it submitted to the Django source-code repository. So keeping it in our tree under the GPL 3 license is just fine given its use under the exact same licence or free-er. Quote:
Please note: I have made a number of minor typo fixes and other changes in your v072c (spelling of HIEGHT -> HEIGHT, etc) and added support for converting PAGE sections to APNX files (and DiapDealer has done a lot of work on the TkGUI) so please use the KindleUnpack_v072d_test I just posted as the basis of any new feature work so that all of these improvements are not lost. Thanks, KevinH Last edited by KevinH; 06-25-2014 at 02:39 PM. Reason: updated to properly respond |
|
![]() |
![]() |
![]() |
#815 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,793
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Hi,
Any of the very recent experimental releases already does that. The HDImages are put in their own HDImages directory when unpacked. KevinH Quote:
|
|
![]() |
![]() |
![]() |
#816 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,731
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
APNX test
Quote:
However, this might have been caused by incorrect pagemap or pagelist definitions. The .apnx files didn't work on my PW2 though. When I put them in the .sdr (sidecar) folder they were deleted and when I put them in the same folder as the .azw3 files they were apparently ignored. It looks like Amazon has modified the .apnx format for PW Kindles because the fake page numbers generated by Calibre don't work either. Please find attached the test files that I used and the sidecar files generated by the PW2 firmware. EDIT: The tool works fine. For details see my next post. Last edited by Doitsu; 06-27-2014 at 05:21 PM. |
|
![]() |
![]() |
![]() |
#817 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
There's an extended header (a few more fields needed, IIRC) needed for KF8 files. Calibre should be using it when processing KF8 files, though.
I'll take a look. @Doitsu: Which FW version are you running, and has your device ever shown 'page numbers' since the last factory reset? (be it in an M7 or KF8 file). IIRC, there's a weird quirk when it sometime doesn't like 'custom' APNX files until something happens (AFAICT, either getting a proper KF8+page book OTA, or opening an M7 one). Because Calibre's APNX work for me, and KindleUnpack appears to be doing the right thing in regards to the extended header for KF8 APNX. I'm not sure I have a properly setup ePub book on hand to try it from scratch, and I'm a bit short on time until next week, but if someone has a dummy reduced testcase that I can try, I'd be happy to ![]() Last edited by NiLuJe; 06-26-2014 at 11:56 AM. |
![]() |
![]() |
![]() |
#818 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,793
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Hi Doitsu,
From the looks of what you sent, yes your PW2 does NOT use or read apnx files. Instead it downloads into sidecar two files. The first is the .azwf which includes history and timing info (almost like the .mbp file). The second is an .azw3r that keeps the apnx data but converted into some other strange format. It almost looks like the .azw3r file is a json or other serialized object version of both an annotation.cache.object, and an apnx.key. The apnx.key has the exact same pagemap information except for completely out of order and with some extra pieces I am not sure about. It may in fact be a serialized java object, a serialized json object, or some other object serializer used for storage and retrieveal in a binary file. So it looks like creating an apnx for a PW2 is not going to be helpful. Sorry about that. But Amazon seems to keep going out of its own way to create a support nightmare for itself with all of its different machine specific formats. I will look into the off by one on the KW and see if I can track down why that is happening. Hopefully I can add a fix for that. Thanks for testing things and providing the sidecar files which helped me track down where the apnx was being stored on the PW2. |
![]() |
![]() |
![]() |
#819 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,793
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Hi Doitsu,
I am trying to track down the "off by one" issue but I am not having any luck. Here is your original epub pagemap info Code:
<page-map xmlns="http://www.idpf.org/2007/opf"> <page href="TOC.xhtml" name=""/> <page href="chapter1.xhtml#id1" name="i"/> <page href="chapter1.xhtml#id2" name="ii"/> <page href="chapter1.xhtml#id3" name="iii"/> <page href="chapter2.xhtml#id4" name="4"/> <page href="chapter2.xhtml#id5" name="5"/> <page href="chapter2.xhtml#id6" name="6"/> <page href="chapter3.xhtml#id7" name="7"/> <page href="chapter3.xhtml#id8" name="8"/> <page href="chapter3.xhtml#id9" name="9"/> [None, 'i', 'ii', 'iii', '4', '5', '6', '7', '8', '9'] [319, 1204, 4739, 8106, 12062, 15606, 18982, 22948, 26492, 29868] Here is what the generated apnx file from that page section says about page numbers and offsets : Decode APNX mobi8-mobi8-pagemap.apnx .APNX 1 75 10 32 2 r 1 5 a 4 [None, 'i', 'ii', 'iii', '4', '5', '6', '7', '8', '9'] [319, 1204, 4739, 8106, 12062, 15606, 18982, 22948, 26492, 29868] So the page names and page offsets are absolutely identical as they should be. And here is the page-map.xml generated when the azw3 was unpacked by KindleUnpack Code:
<page-map xmlns="http://www.idpf.org/2007/opf"> <page name="i" href="Text/part0001.xhtml#id1" /> <page name="ii" href="Text/part0001.xhtml#id2" /> <page name="iii" href="Text/part0001.xhtml#id3" /> <page name="4" href="Text/part0002.xhtml#id4" /> <page name="5" href="Text/part0002.xhtml#id5" /> <page name="6" href="Text/part0002.xhtml#id6" /> <page name="7" href="Text/part0003.xhtml#id7" /> <page name="8" href="Text/part0003.xhtml#id8" /> <page name="9" href="Text/part0003.xhtml#id9" /> Hmm ... so nothing appears to be off by one here. So can you locate where things appearing to be off by one starts and let me know so that I can try and see if the original xhtml coding is an issue or if the issue is just that more than one page is on the screen at the same time (which is device specific). Thanks, KevinH |
![]() |
![]() |
![]() |
#820 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,731
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
I really don't understand why Amazon don't release the tool that they use to generate .apnx and .azw3r files. In case Kovid read this, my model's serial number prefix is 90D4 and my firmware is 5.4.3.2. The latest Calibre version obviously cannot generate .azw3r files, because the format hasn't been reverse engineered yet, and transferring .apnx files to sidecar folders is pointless, because they'll be deleted when the book is opened for the first time. BTW, I'm still puzzled about the "page number drift" that happened on my K3 after the first three pages. I most likely specified the page targets incorrectly or overlooked some other constraints. Maybe someone else who successfully implemented page numbers for a commercial Kindle book can shed some light on this. Each chapter should start with an odd page number, you can see this for example, when you open chapter 3, which should start with page 7, but page 6 is being displayed. All .html pages are identical, except for the page target ids. Last edited by Doitsu; 06-26-2014 at 01:07 PM. |
|
![]() |
![]() |
![]() |
#821 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,793
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Updated Test Version: KindleUnpack_v072f_test.zip
Attached is an updated test version of KindleUnpack_v072f_test.zip.
New features: - Greatly Improved GUI with support for: - epub version setting - using HDImages if present - full saving and retrieving of your GUI settings as preferences - HD_Images will now automatically overwrite their lower res cousins if that option is selected. - PAGE Unpacking has minor bug fixes - bug fixes for Windows machines using paths that require full unicode. Testers and Interested Users: Please give this a try and report back any issues Please use this version as the basis for any future work. Many files have been touched and bugs with paths fixed. Hopefully we can now just bug fix and polish before an official release. I still would like to prune out any redundant code. For example I have now imported get_image_type from mobi_cover to help remove redundant code in processImage and processCRES in kindlenpack.py and fixed a few bugs related to that. I would also like to greatly reduce the redundancy in the opf creation code as well before going final. Last edited by KevinH; 06-26-2014 at 04:12 PM. |
![]() |
![]() |
![]() |
#822 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
Okay, gave a go at Doitsu's pagemap file, and, yup, it definitely works for me.
Even the roman numerals stuff works (which I'd never actually seen before, so, yay). On most devices supporting KF8 (AFAICT, everything *except* the K3, though I haven't checked the K3 thing), the apnx file *HAS* to go in the sidecar (.sdr) folder though. Since I'm doing this over SSH, I pushed the files in reverse to make sure the scanner didn't do something stupid (ie. pushed the sidecar folder, the apnx, and then the azw3). And yes, the framework consumes the APNX file and builds the azw3f & azw3r couple. (Yes, it's a Touch, but it's running on the 5.3 branch, results should be identical on a PW/PW2). FWIW, I'm seeing Page 6 after a goto Chapter 3, too. Could it be because the id anchor (or however that thing works ![]() I'm also not seeing a page number for the "Chapter 1" entry in the GoTo menu, I'm guessing for the same kind of reasons that the 'off-by-one' thing. If I "GoTo" page 7, I don't see the chapter heading anymore, (ie. ==== PAGE 7 ==== is at the top), and I'm indeed on page 7. Haven't looked at the source, but that would seem to correlate with my hunch. Last edited by NiLuJe; 06-26-2014 at 03:35 PM. |
![]() |
![]() |
![]() |
#823 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,793
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Quote:
So could you please try editing your epub to change things slightly for the start of every chapter. Try going from your current code where the actual page start location actually comes after the chapter heading to before it as follows: from: Code:
<body> <h3>Chapter 1</h3> <p><a id="id1"></a><b>==== PAGE 1 ====</b> Code:
<body id="id1"> <h3>Chapter 1</h3> <p><b>==== PAGE 1 ====</b> Code:
<body> <h3 id="id1">Chapter 1</h3> <p><b>==== PAGE 1 ====</b> Thanks, Kevin |
|
![]() |
![]() |
![]() |
#824 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047202
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@KevinH: Yay! That confirms my hunch (cf. my previous message, which has been edited 7 billion times already ^^)
![]() I'll be happy to check updated files on my end too ![]() |
![]() |
![]() |
![]() |
#825 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,793
Karma: 6000000
Join Date: Nov 2009
Device: many
|
Hi NiLuJe,
Yes, please try both alternative epub changes for each chapter and see if either will work properly and let me know what you see. I really don't like using id= inside a "body" tag as the target should then just be the top of file for consistentcy and simplicity. I am glad to hear that a sideloaded apnx file can be consumed and that the .azw3r and .azw3f funny pieces are created during reading. I hope Doitsu can do the same thing with his PW2. One other variation to try might be: Code:
<body> <a id="id1"></a> <h3>Chapter 1</h3> <p><b>==== PAGE 1 ====</b> Thanks! KevinH |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |