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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 01-06-2009, 07:28 PM   #1
ees
Member
ees began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jan 2009
Device: none
Prepagination

Hi,

First, thanks for the excellent work on calibre!

I just discovered that news feeds in LRF format seem to reset the Reader (Sony PSR-505). As many have pointed out, two work-arounds are:

1) use EPUB, or
2) use LRF, but transfer the file to the Reader using Sony's software, which performs pre-pagination.

While both approaches have worked, I would really like to use LRF *and* avoid reliance on Sony's software. I prefer LRF because it justifies text, whereas EPUB currently does not. And because I've been blessed/cursed with GNU/Linux, using Sony's software really isn't much of an option for me.

Is there any way to add pre-pagination in calibre for LRF? Do we know how to it (but lack the manpower), or is there a fair amount of reverse-engineering that still needs to be done?

Thanks!

- e
ees is offline   Reply With Quote
Old 01-06-2009, 07:34 PM   #2
pilotbob
Grand Sorcerer
pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.
 
pilotbob's Avatar
 
Posts: 19,832
Karma: 11844413
Join Date: Jan 2007
Location: Tampa, FL USA
Device: Kindle Touch
Quote:
Originally Posted by ees View Post
Is there any way to add pre-pagination in calibre for LRF? Do we know how to it (but lack the manpower), or is there a fair amount of reverse-engineering that still needs to be done?
Boy this sholld be in the FAQ if it is not. Kovid has said many times that this is not going to be done by him. Of course, patches are welcome.

BOb
pilotbob is offline   Reply With Quote
Advert
Old 01-06-2009, 07:40 PM   #3
ees
Member
ees began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jan 2009
Device: none
Quote:
Originally Posted by pilotbob View Post
Boy this sholld be in the FAQ if it is not. Kovid has said many times that this is not going to be done by him. Of course, patches are welcome.

BOb
Fair enough! I'll take a peek. Pointers, tips, or en/dis-couragement always appreciated.

- e
ees is offline   Reply With Quote
Old 01-06-2009, 07:42 PM   #4
Andurian
You really should try it!
Andurian doesn't litterAndurian doesn't litter
 
Posts: 57
Karma: 137
Join Date: Nov 2008
Device: PRS-500
I'm happy the question was asked, because until I read it I didn't know that epub doesn't justify text. I had been using LRF exclusively and hate justification.

Happy me!
Andurian is offline   Reply With Quote
Old 01-06-2009, 07:43 PM   #5
pilotbob
Grand Sorcerer
pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.
 
pilotbob's Avatar
 
Posts: 19,832
Karma: 11844413
Join Date: Jan 2007
Location: Tampa, FL USA
Device: Kindle Touch
Quote:
Originally Posted by ees View Post
Fair enough! I'll take a peek. Pointers, tips, or en/dis-couragement always appreciated.

- e
Sorry. I can't be of much help there. I would say

1. You would need to write it in Python.
2. You would need to determine how this is done by reverse engineering the indexing that the Sony eBook Library or the device itself does. I have no idea where this index is stored.. but possible Kovid or Igor could help you here.

BOb
pilotbob is offline   Reply With Quote
Advert
Old 01-06-2009, 07:51 PM   #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: 43,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The problem is you have to exactly duplicate the rendering algorithm used by SONY's LRF renderer. The LRF viewer in calibre comes close, but not quite. Once you do that, the rest should be easy.
kovidgoyal is offline   Reply With Quote
Old 01-06-2009, 07:52 PM   #7
ees
Member
ees began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jan 2009
Device: none
Quote:
Originally Posted by Andurian View Post
I'm happy the question was asked, because until I read it I didn't know that epub doesn't justify text. I had been using LRF exclusively and hate justification.

Happy me!
As an aside, does anyone know whether the lack of justification in EPUB is a limitation in the generated EPUB file or in the device firmware?

- e
ees is offline   Reply With Quote
Old 01-06-2009, 07:57 PM   #8
ees
Member
ees began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jan 2009
Device: none
Quote:
Originally Posted by kovidgoyal View Post
The problem is you have to exactly duplicate the rendering algorithm used by SONY's LRF renderer. The LRF viewer in calibre comes close, but not quite. Once you do that, the rest should be easy.
Do you mean to suggest that when I use Sony's software to transfer a calibre-generated LRF file, Sony's software 1) reads in calibre's LRF file, 2) re-renders it using Sony's rendering algorithm, and 3) pre-paginates the result?

Thanks,
- e
ees is offline   Reply With Quote
Old 01-06-2009, 08:01 PM   #9
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: 43,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by ees View Post
Do you mean to suggest that when I use Sony's software to transfer a calibre-generated LRF file, Sony's software 1) reads in calibre's LRF file, 2) re-renders it using Sony's rendering algorithm, and 3) pre-paginates the result?

Thanks,
- e
Yes, I do
kovidgoyal is offline   Reply With Quote
Old 01-06-2009, 08:15 PM   #10
ees
Member
ees began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jan 2009
Device: none
Quote:
Originally Posted by kovidgoyal View Post
The problem is you have to exactly duplicate the rendering algorithm used by SONY's LRF renderer. The LRF viewer in calibre comes close, but not quite. Once you do that, the rest should be easy.
Thanks so much for the insight.

You also seem to suggest that it is important to exactly duplicate Sony's LRF rendering algorithm *before* applying any pre-pagination. Assuming we know what the pre-pagination algorithm alone involves (do we?), what would happen if we simply apply pre-pagination to the calibre's LRF output?

In other words, what do you hypothesize will happen if we skip Sony's LRF re-rendering step?

Is the problem one of reverse-engineering, namely that we don't know what Sony's pagination algorithm involves, and that it's hard to diff calibre's LRF output with Sony's LRF output (with pagination) because there are too many things changing (i.e., Sony's rendering changes, plus pagination changes)?

(Or did I miss a concept?)

Thanks,
- e
ees is offline   Reply With Quote
Old 01-06-2009, 08:19 PM   #11
pilotbob
Grand Sorcerer
pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.pilotbob ought to be getting tired of karma fortunes by now.
 
pilotbob's Avatar
 
Posts: 19,832
Karma: 11844413
Join Date: Jan 2007
Location: Tampa, FL USA
Device: Kindle Touch
Quote:
Originally Posted by ees View Post
In other words, what do you hypothesize will happen if we skip Sony's LRF re-rendering step?
Ok... I'm assuming here... and so is Kovid I expect... that the eBook library renders the LRF file to determine the start and stop position/location of each page in the eBook for each font size. This information is used for navigation on the device when reading the ebook.

My guess would be if you are a bit off... it won't really hurt to much in that the page number may be a bit off. I could be wrong of course.

BOb
pilotbob is offline   Reply With Quote
Old 01-06-2009, 08:23 PM   #12
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: 43,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Look at the media.xml file on your device. It contains the prepagination information (hex encoded IIRC). LRF is a (partially) reflowable format. What the pre pagination does is tell the reader how many screens of text are there at a particular font size and where in the file each screen starts and ends. So to duplicate that, you have to layout the text on an in-memory screen exactly as the reader would. If you are a little off, that will result in missing lines of text, as you see when you replace the fonts on the reader with others that have different metrics and then try to use a pre paginated book
kovidgoyal is offline   Reply With Quote
Old 01-06-2009, 08:27 PM   #13
llasram
Reticulator of Tharn
llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.llasram ought to be getting tired of karma fortunes by now.
 
llasram's Avatar
 
Posts: 618
Karma: 400000
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Quote:
Originally Posted by kovidgoyal View Post
Yes, I do
Oh, that's harsh, Kovid .
llasram is offline   Reply With Quote
Old 01-06-2009, 08:35 PM   #14
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: 43,776
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Quote:
Originally Posted by llasram View Post
Oh, that's harsh, Kovid .
I just spent the last hour shoving my wife's car out of a snowed in parking lot. I've had it with snow! Iguess ees nick reminded me of a snowflake or something
kovidgoyal is offline   Reply With Quote
Old 01-06-2009, 08:46 PM   #15
ees
Member
ees began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Jan 2009
Device: none
Quote:
Originally Posted by kovidgoyal View Post
I just spent the last hour shoving my wife's car out of a snowed in parking lot. I've had it with snow! Iguess ees nick reminded me of a snowflake or something
There's snow in Pasadena? Wow!
ees is offline   Reply With Quote
Reply

Tags
lrf, news, prepagination

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump


All times are GMT -4. The time now is 05:08 PM.


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