View Single Post
Old 01-11-2008, 03:55 AM   #138
Avid reader
Jaapjan doesn't litterJaapjan doesn't litter
Jaapjan's Avatar
Posts: 262
Karma: 132
Join Date: Mar 2005
Location: The Netherlands
Device: HTC Touch Diamond, iLiad Book Edition
Originally Posted by tompe View Post
The Perl modules Palm::PDB and Palm:oc takes care of the compression and the decompression but this will not work for highest compression because this compression is a secret MobiPocket scheme. I had to overide some code in one of these modules for it to work on some DRM:ed files (also decompress if version was 5).
I found a document from 2002 or something akin to that which described the regular compression scheme used and I implemented those now, more or less. (Since I hardly have the Perl modules available. Non perl code.) I have yet to run into any odd Mobi-format.. but then, I have not been looking. Maybe when the code can do a little more.

Originally Posted by tompe View Post
The Palm Doc header tells how many records there are in the document. I think that the last two small records that are there sometimes and images are just add ons to the original format and these add ons are not compressed.
True, but when you start decompressing the data at PDB record 1 (0 being the one holding the PDB 0 header, Mobi Header and EXTH header, how do you know when to end that file. For that matter, to what file does the HTML you're decoding belong to anyway. The index?

Originally Posted by tompe View Post
I have kind of wondered about that also. The number of records for my Oxford Concise Dictionary was ridiculous. Maybe it speeds up the searching or something like that. If you have one word per record for example...
Perhaps memory constrained devices read these blocks in memory as sort of cache and move to the next and / or previous one only when needed.
Jaapjan is offline   Reply With Quote