Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 04-26-2019, 10:16 PM   #1
nosmokingbandit
Member
nosmokingbandit began at the beginning.
 
Posts: 17
Karma: 10
Join Date: May 2015
Device: Kindle 3G B006
Logical TOC in mobi binary

To make a long story short I'm making an ebook converter in C#. So far everything is great when creating a mobi except what I believe is called the "logical toc." In case I've got the terminology wrong, whats happening is that I do not have seekable tick marks on the progress bar at each chapter (or wherever else you want a tick mark).

The Wiki page doesn't have any info I could find about this. I understand that KindleGen uses an epub-style toc.ncx, but I am unable to find how this is serialized into the mobi file.

I've looked through Calibre's source code but it is a bit of a spaghetti nightmare.

Anyone know of any good resources for how mobi files are generated?
nosmokingbandit is offline   Reply With Quote
Old 04-28-2019, 11:42 AM   #2
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Not on generation of mobi files, but on unpacking Mobi 7 and Mobi 8 files. If you want to see how the ncx equivalent is unpacked from a Mobi index database record, see github for KindleUnpack here:

https://github.com/kevinhendricks/KindleUnpack

The binary index format is quite a pain but you can see how to unpack one once the proper record has been identified. Although similar, the ncx info in Mobi 6 and 7, differs from the more epub like Mobi 8 ncx info.

Look in the lib directory for kindleunpack.py, mobi_index.py, and mobi_ncx.py.

The easiest way to understand the binary format is generate a mobi 8 using Kindlegen from a known epub with an elaborate ncx and upack it with added debug statements added to the mobi_index.py and mobi_ncx.py code.
KevinH is offline   Reply With Quote
Advert
Old 04-29-2019, 07:35 PM   #3
nosmokingbandit
Member
nosmokingbandit began at the beginning.
 
Posts: 17
Karma: 10
Join Date: May 2015
Device: Kindle 3G B006
KindleUnpack's source is much easier to read, but reversing the process might prove a bit tricky. I'll take a close look at it.

Whoever decided to use the mobi format for the world's most popular eReader should be tried for crimes against humanity.
nosmokingbandit is offline   Reply With Quote
Old 04-30-2019, 07:09 AM   #4
Little.Egret
Wizard
Little.Egret ought to be getting tired of karma fortunes by now.Little.Egret ought to be getting tired of karma fortunes by now.Little.Egret ought to be getting tired of karma fortunes by now.Little.Egret ought to be getting tired of karma fortunes by now.Little.Egret ought to be getting tired of karma fortunes by now.Little.Egret ought to be getting tired of karma fortunes by now.Little.Egret ought to be getting tired of karma fortunes by now.Little.Egret ought to be getting tired of karma fortunes by now.Little.Egret ought to be getting tired of karma fortunes by now.Little.Egret ought to be getting tired of karma fortunes by now.Little.Egret ought to be getting tired of karma fortunes by now.
 
Posts: 3,168
Karma: 37800000
Join Date: Jan 2010
Location: Walton-on-Thames, Surrey, England, UK
Device: Kindle Keyboard 3G, Kindle Fire 2, NOOK ST, Kindle HDX, Fire 7"
Quote:
Originally Posted by nosmokingbandit View Post
KindleUnpack's source is much easier to read, but reversing the process might prove a bit tricky. I'll take a close look at it.

Whoever decided to use the mobi format for the world's most popular eReader should be tried for crimes against humanity.
When some cheapjack made that decision, the Kindle e-reader was only a concept and ePub not even that.
Little.Egret is offline   Reply With Quote
Old 04-30-2019, 10:11 AM   #5
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
That said, the newer kindle formats created more recently like PrintReplica, KFX and others are just as intricate and convoluted.
KevinH is offline   Reply With Quote
Advert
Old 04-30-2019, 06:24 PM   #6
nosmokingbandit
Member
nosmokingbandit began at the beginning.
 
Posts: 17
Karma: 10
Join Date: May 2015
Device: Kindle 3G B006
I've worked with plenty of database styled files in the past, but nothing comes even close to being as obtuse as mobi.
nosmokingbandit is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple HTML files w/ TOC to MOBI, not added in order listed in TOC dysfunction Conversion 3 01-03-2014 12:40 AM
Mobi to Mobi TOC issue chrisgroch Conversion 7 04-19-2012 03:21 PM
No TOC in mobi Fabe Sigil 4 01-28-2012 04:00 AM
I KNEW that there was a logical explaination for Roswell! ardeegee Lounge 8 05-20-2011 01:26 AM
ePub TOC to mobi TOC edmnddntes Conversion 5 01-24-2011 02:56 AM


All times are GMT -4. The time now is 02:45 AM.


MobileRead.com is a privately owned, operated and funded community.