Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 11-17-2011, 07:14 AM   #1
Boris4Perl
Junior Member
Boris4Perl began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Nov 2011
Device: none
Question Question about Header and Format

Hello dear Community,

I am new to this forum and also to e-books in general. It happend that I'm asked to build the mobi-format in Perl. I know already about MobiPerl, and I'm reading it's source code already. Currently I'm still trying to understand the mobi-format, and so my question is related to this issue.

To understand the mobi-format I read your helpful wiki-page: http://wiki.mobileread.com/wiki/MOBI

There it says that the first two bytes (from offset 0) are about "Compression", here is the chapter I'm talking about: http://wiki.mobileread.com/wiki/MOBI#PalmDOC_Header

So now I'm already confused! Because I created two mobi-binaries out from a simple HTML-file, once using Calibre and the other time using MobiPerl's html2mobi. The generated mobi file is viewable in "fbreader", so they seem to be valid (though the two files look a bit different, but that's not the issue right now). When I look at the bytes in this generated files I see that in both of them the first bytes are used for the title, which is not what the wiki-page is saying.

Here the binary output:
Code:
$ hexdump -C calibre_html.mobi | head -2
00000000  4d 65 64 69 75 6d 5f 54  65 73 74 5f 44 6f 63 75  |Medium_Test_Docu|
00000010  6d 65 6e 74 00 00 00 00  00 00 00 00 00 00 00 00  |ment............|
$ hexdump -C mobiperl_html.mobi | head -2
00000000  4d 65 64 69 75 6d 20 54  65 73 74 20 44 6f 63 75  |Medium Test Docu|
00000010  6d 65 6e 74 00 00 00 00  00 00 00 00 00 00 00 00  |ment............|
"Medium Test Document" is the title of the document, and this are the first bytes. But in the wiki it says that the first bytes are used differently. Now this makes it difficult for me to understand the format. Can anybody help me in this?
Is the wiki-page still reliable? Is there another resource I can look at?
Am I doing something wrong?

Thank you very much.
Boris
Boris4Perl is offline   Reply With Quote
Old 11-17-2011, 07:47 AM   #2
Boris4Perl
Junior Member
Boris4Perl began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Nov 2011
Device: none
Solved it myself

ok... after reading more carefully I found the solution myself:

The whole thing is encapsulated in the "Palm_Database_Format"
http://wiki.mobileread.com/wiki/PDB#...atabase_Format

There the first 32 bytes are reserved for "name".

Hope the solution helps other people who like to overread thing ;-)
Boris4Perl is offline   Reply With Quote
Old 11-17-2011, 08:16 AM   #3
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 8,909
Karma: 40221964
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Like PalmDOC, the Mobipocket file format is that of a standard Palm Database Format file. The header of that format includes the name of the database (usually the book title and sometimes a portion of the authors name) which is up to 31 bytes of data.
Quote:
The first record in the Palm Database Format gives more information about the Mobipocket file. The first 16 bytes are almost identical to the first sixteen bytes of a PalmDOC format file.
The compression bytes are the first two bytes in the first record of the Palm Database Format not the first two bytes of the file.

The details for the Palm Database Format can be found in the Palm Database Format wiki.

That info isn't duplicated in the MOBI wiki because it's the same.

EDIT: While I was typing away trying to explain it... you figured out yourself.
DiapDealer is online now   Reply With Quote
Reply

Tags
byte, format, header, mobi

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
EXTH Header Question RecQuery Kindle Formats 1 06-07-2011 02:28 PM
Format Question dkb Sony Reader 2 10-20-2010 09:25 PM
LRF header question =X= Calibre 2 11-12-2009 08:06 PM
Question about the best format(s). morajelly Sony Reader 14 07-14-2009 10:44 PM
PRS-500 PDB header format Avian Sony Reader Dev Corner 14 10-03-2007 09:39 AM


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


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