View Single Post
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: https://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: https://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