01-05-2007, 09:30 AM | #1 |
Enthusiast
Posts: 38
Karma: 36
Join Date: Dec 2006
Device: Sony Reader PRS-500
|
LRF ObjectInfo format
I've got BBeB Binder now to handle images (one image only per page) at the moment and I kind of understand the basic layout for this (24 bytes with a int value of 1 followed by and int value of the block id).
However looking at some other books which have text and images withina page, this structure gets increasingly complex and I have no idea what the values mean (plus it seems to differ depending on what type of objects are on the page). So, does anyone know the format of the LRF ObjectInfo stream, and also what this is used for? Cheers Andy |
01-05-2007, 04:28 PM | #2 |
creator of calibre
Posts: 44,550
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Have you seen
http://www.sven.de/librie/Librie/LrfFormat |
Advert | |
|
01-05-2007, 06:53 PM | #3 |
Enthusiast
Posts: 38
Karma: 36
Join Date: Dec 2006
Device: Sony Reader PRS-500
|
I have indeed but it doesn't describe the ObjectInfo object stream format.
I've also looked throught the lrf2lrs code, the LRFParser code, and other OS code and none have a definition of the format. The closest I got was the java based BBeBook code - but whilst I've got it working now (in a rudimentary fashion), some other books I've looked at have much more involved streams which I can't make head nor tail of! |
01-05-2007, 07:02 PM | #4 |
creator of calibre
Posts: 44,550
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Hmm 'fraid my knowledge of the LRF format is limited to the header. Are you trying to write an lrf parser and/or conversion tool?
|
01-06-2007, 08:57 AM | #5 |
Enthusiast
Posts: 38
Karma: 36
Join Date: Dec 2006
Device: Sony Reader PRS-500
|
Yup, I'm helping with the BBeB Binder tool which converts from HTML/Text to LRF. It can also read LRF and convert that the HTML.
As mentioned above, I've managed to get text and image elements displayed on a page but I'm sure I'm not doing things quite right - or am missing some bits. I'm also not actually sure what this Object is used for |
Advert | |
|
01-06-2007, 12:50 PM | #6 |
creator of calibre
Posts: 44,550
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Hmm well best of luck. If you want embedded images, I would generate a few simple one page files with embedded images using the librie toolbar and reverse engg from there.
|
01-06-2007, 01:53 PM | #7 | |
Banned
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
|
Quote:
One helpful key to understanding LRF maybe to understand that LRF is, in its simplest form, binary encoded XML. The XML tags have been parsed and replaced with numbers. The tag attributes are similarly parsed and converted to numbers with encoded values. This makes the LRF file smaller and quicker to parse for an embedded device. I'm re-factoring BBeBook for 0.3 and it will make this even more clear. |
|
01-06-2007, 02:18 PM | #8 | |
Connoisseur
Posts: 69
Karma: 34
Join Date: Dec 2006
Location: Dallas, TX
Device: PRS-500
|
Quote:
You were creating two ObjectInfo objects, one that with a PAGE_LAYOUT payload, and another that with a PAGE_NUMBERS payload. The PAGE_NUMBERS payload seems pretty easy to figure out, but the PAGE_LAYOUT payload isn't fully defined. You create it by allocating a 24 byte array, but you only fill in the first 8 bytes, and leave the last 16 bytes all zeros. From looking at other LRF's it appears that the PAGE_LAYOUT payload contains a uint32 counter value which contains the number of records, followed by that number of 24 byte records - only the first 8 bytes we currently understand. I haven't even tried yet to look at the last 16 bytes yet to see what it contains for other books. I have found one other book that doesn't seem to fill in the PAGE_LAYOUT payload this way, but I'm wondering if this may be an improperly created eBook. I'm still trying to find out its origin. |
|
01-06-2007, 05:30 PM | #9 | |
Banned
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
|
Quote:
The other pointers in the PAGE_LAYOUT are of course ignored when set to 0. The other pointers are used to setup the header and footer descriptors. THe Sony Reader seems to handle the header properly in the Sony Store books I've been reading so I may be adding support for it. |
|
01-06-2007, 06:07 PM | #10 | |
Connoisseur
Posts: 69
Karma: 34
Join Date: Dec 2006
Location: Dallas, TX
Device: PRS-500
|
Quote:
No the "we" is Andy and I - want to join the project? Those 24 bytes don't seem to be a simple array of object ID's from what I can tell. Have you come across any more information somewhere? |
|
01-06-2007, 06:18 PM | #11 |
Banned
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
|
Sorry, Java is "fun", .Net is "work".
I wrote a non-resize book binder as well and it knows how to do the headers/footers etc... I need to analyze what the Sony Reader does with its books. |
01-08-2007, 08:03 AM | #12 |
Wizard
Posts: 3,442
Karma: 300001
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
|
I will try to look into it some time later, but I *think* ObjectInfo is optional. Did you try generating files without it?
|
01-08-2007, 12:49 PM | #13 | |
Connoisseur
Posts: 65
Karma: 1695
Join Date: Oct 2006
|
Quote:
Look at Lrf2lrs python program (yahoo librie group, or last version at this forum), by roxfan, Igor Skochinsky (aka igorsk): all LRF format is in there. |
|
01-08-2007, 01:10 PM | #14 |
Wizard
Posts: 3,442
Karma: 300001
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
|
Well, not all I skip over some things which are not important for decomilation (like ObjectInfo).
|
01-08-2007, 02:20 PM | #15 |
Banned
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
|
My guess would be its optional if you supply something else. I know if I left it out on the Librie the book was unviewable.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Readabilty of LRF format | poshm | LRF | 12 | 02-20-2010 04:19 AM |
LRF Format | eibix | PocketBook | 9 | 01-14-2010 01:35 PM |
Best Format To Convert to LRF | ewilson13 | LRF | 3 | 12-04-2009 07:50 AM |
PRS-600 LRF Format and the 600 | kazbates | Sony Reader | 9 | 09-20-2009 10:27 AM |
Any detailed info about the LRF format? | daqi | Sony Reader Dev Corner | 2 | 04-16-2008 12:31 PM |