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

Go Back   MobileRead Forums > E-Book Readers > Sony Reader > Sony Reader Dev Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 01-05-2007, 08:30 AM   #1
AndyQ
Enthusiast
AndyQ began at the beginning.
 
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
AndyQ is offline   Reply With Quote
Old 01-05-2007, 03:28 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,952
Karma: 5036099
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Have you seen
http://www.sven.de/librie/Librie/LrfFormat
kovidgoyal is online now   Reply With Quote
 
Enthusiast
Old 01-05-2007, 05:53 PM   #3
AndyQ
Enthusiast
AndyQ began at the beginning.
 
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!
AndyQ is offline   Reply With Quote
Old 01-05-2007, 06:02 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,952
Karma: 5036099
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?
kovidgoyal is online now   Reply With Quote
Old 01-06-2007, 07:57 AM   #5
AndyQ
Enthusiast
AndyQ began at the beginning.
 
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
AndyQ is offline   Reply With Quote
Old 01-06-2007, 11:50 AM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 25,952
Karma: 5036099
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.
kovidgoyal is online now   Reply With Quote
Old 01-06-2007, 12:53 PM   #7
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
Quote:
Originally Posted by AndyQ
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!
BBeBook generates fully resize-able LRF files. I haven't analyzed the Sony Reader files to see if it allows more sophistication in reflow. The Librie allowed for very little sophistication.

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.
scotty1024 is offline   Reply With Quote
Old 01-06-2007, 01:18 PM   #8
cmumford
Connoisseur
cmumford began at the beginning.
 
cmumford's Avatar
 
Posts: 69
Karma: 34
Join Date: Dec 2006
Location: Dallas, TX
Device: PRS-500
Quote:
Originally Posted by scotty1024
BBeBook generates fully resize-able LRF files. I haven't analyzed the Sony Reader files to see if it allows more sophistication in reflow. The Librie allowed for very little sophistication.

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.
Hi scotty1024. BBeB Binder was actually based on the source to BBeBook. We started with your BBeBook and BBeBObject classes, and are slowly moving toward our own as our understanding of the format increases.

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.
cmumford is offline   Reply With Quote
Old 01-06-2007, 04:30 PM   #9
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
Posts: 1,300
Karma: 1479
Join Date: Jul 2006
Location: Peoples Republic of Washington
Device: Reader / iPhone / Librie / Kindle
Quote:
Originally Posted by cmumford
Hi scotty1024. BBeB Binder was actually based on the source to BBeBook. We started with your BBeBook and BBeBObject classes, and are slowly moving toward our own as our understanding of the format increases.
Is that a royal "our" there?

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.
scotty1024 is offline   Reply With Quote
Old 01-06-2007, 05:07 PM   #10
cmumford
Connoisseur
cmumford began at the beginning.
 
cmumford's Avatar
 
Posts: 69
Karma: 34
Join Date: Dec 2006
Location: Dallas, TX
Device: PRS-500
Quote:
Originally Posted by scotty1024
Is that a royal "our" there?

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.
We like to think so

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?
cmumford is offline   Reply With Quote
Old 01-06-2007, 05:18 PM   #11
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
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.
scotty1024 is offline   Reply With Quote
Old 01-08-2007, 07:03 AM   #12
igorsk
Wizard
igorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfolded
 
Posts: 3,443
Karma: 52235
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?
igorsk is offline   Reply With Quote
Old 01-08-2007, 11:49 AM   #13
obelix
Connoisseur
obelix once ate a cherry pie in a record 7 seconds.obelix once ate a cherry pie in a record 7 seconds.obelix once ate a cherry pie in a record 7 seconds.obelix once ate a cherry pie in a record 7 seconds.obelix once ate a cherry pie in a record 7 seconds.obelix once ate a cherry pie in a record 7 seconds.obelix once ate a cherry pie in a record 7 seconds.obelix once ate a cherry pie in a record 7 seconds.obelix once ate a cherry pie in a record 7 seconds.obelix once ate a cherry pie in a record 7 seconds.obelix once ate a cherry pie in a record 7 seconds.
 
Posts: 64
Karma: 1695
Join Date: Oct 2006
Quote:
Originally Posted by igorsk
I will try to look into it some time later, but I *think* ObjectInfo is optional. Did you try generating files without it?
ObjectInfo is definitely optional. In my Lrs to Lrf parcer ( http://www.msh-tools.com/ebook/MSH_LRSParser.zip ) (which is good for both Librie and Reader and supports resizable lrfs, headers/footers and buttons etc) this object is not used at all. As far as I know XYLogParcel also does not create this object by default.

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.
obelix is offline   Reply With Quote
Old 01-08-2007, 12:10 PM   #14
igorsk
Wizard
igorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfoldedigorsk reads XML... blindfolded
 
Posts: 3,443
Karma: 52235
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).
igorsk is offline   Reply With Quote
Old 01-08-2007, 01:20 PM   #15
scotty1024
Banned
scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.scotty1024 is no ebook tyro.
 
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.
scotty1024 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Readabilty of LRF format poshm LRF 12 02-20-2010 03:19 AM
LRF Format eibix PocketBook 9 01-14-2010 12:35 PM
Best Format To Convert to LRF ewilson13 LRF 3 12-04-2009 06:50 AM
PRS-600 LRF Format and the 600 kazbates Sony Reader 9 09-20-2009 09:27 AM
Any detailed info about the LRF format? daqi Sony Reader Dev Corner 2 04-16-2008 11:31 AM


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


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