Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Other formats > LRF

Notices

Reply
 
Thread Tools Search this Thread
Old 04-02-2009, 11:22 AM   #166
igorsk
Wizard
igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.igorsk ought to be getting tired of karma fortunes by now.
 
Posts: 3,442
Karma: 300001
Join Date: Sep 2006
Location: Belgium
Device: PRS-500/505/700, Kindle, Cybook Gen3, Words Gear
Quote:
Originally Posted by elinares View Post
I've tested both books with Calibre, it can not show or transform none of them. The unscrambling method described on sven.de/librie is exactly the same I implemented in LRFTools, but for some streams it does not work.

I'm going to pm you the books.
Thanks for the sample. I did a little debugging, and apparently the correct calculation looks like this:
Code:
uint8_t get_local_key(int streamlen, uint8_t key)
{
  if ( key && key <= 0xF0u )
    return streamlen % key + 0xF;
  else
    return 0;
}
Note the extra check and that only 8 bits of the key are used.
igorsk is offline   Reply With Quote
Old 04-03-2009, 10:24 AM   #167
elinares
Xtreme Quijote
elinares doesn't litterelinares doesn't litterelinares doesn't litter
 
elinares's Avatar
 
Posts: 101
Karma: 208
Join Date: Sep 2008
Location: La Mancha, Spain
Device: Sony PRS-505
Quote:
Originally Posted by igorsk View Post
Thanks for the sample. I did a little debugging, and apparently the correct calculation looks like this:
Hi igorsk,
I've testing the algorithm and this is working right now for me:
Code:
        BYTE keybyte;

        declen = LengthOfStream
        keybyte = (declen % (PsuedoEncryptionKeyByte&0xFF)) + 0x0F; 
        if ((type == 0x11)||(type == 0x19)||(type == 0x17))
        {
            if (declen > 0x400) declen = 0x400;
        }       
        for (i = 0; i < declen; i++) {
            *(p + i) ^= keybyte;
        }
For both books (Ed Lacy) PseudoEncriptionKeyByte = -480 (int);
but -480&0xFF = 32, that`s the correct module for declen.
elinares is offline   Reply With Quote
Advert
Old 04-03-2009, 12:52 PM   #168
elinares
Xtreme Quijote
elinares doesn't litterelinares doesn't litterelinares doesn't litter
 
elinares's Avatar
 
Posts: 101
Karma: 208
Join Date: Sep 2008
Location: La Mancha, Spain
Device: Sony PRS-505
Quote:
Originally Posted by RandallFlagg View Post
I tried out your fix and it was able to convert lrf to epub. I was able to add a cover via Calibre. Unfortunately all the text was pushed together, no idents or paragraphs. Also the fonts change size throughout the book and line spacing isn't consistant. Thanks and I'll try it again should you make any newer changes. Lastly, I just reconverted it again to make sure it wasn't Calibre when I converted back to lrf. It's not, the epub looks like this in Adobe DE.
Hi RandallFlagg,
I've performed some changes to lrf conversion as you can see:

I'm going to upload this new version right now.
Attached Thumbnails
Click image for larger version

Name:	edlacy1.jpg
Views:	1238
Size:	186.7 KB
ID:	27057  
elinares is offline   Reply With Quote
Old 04-03-2009, 01:51 PM   #169
elinares
Xtreme Quijote
elinares doesn't litterelinares doesn't litterelinares doesn't litter
 
elinares's Avatar
 
Posts: 101
Karma: 208
Join Date: Sep 2008
Location: La Mancha, Spain
Device: Sony PRS-505
New Version v0.9.204

Finally I've found correct way to descrambling streams in LRF, including images; and also I've corrected many bugs regarding text flow.
@RandallFlag: thanks for the examples
@igorsk:thanks for your info.
Enjoy,
Eladio
elinares is offline   Reply With Quote
Old 04-03-2009, 02:34 PM   #170
RandallFlagg
Hey Trashcan Man
RandallFlagg will become famous soon enoughRandallFlagg will become famous soon enoughRandallFlagg will become famous soon enoughRandallFlagg will become famous soon enoughRandallFlagg will become famous soon enoughRandallFlagg will become famous soon enough
 
RandallFlagg's Avatar
 
Posts: 66
Karma: 658
Join Date: Jan 2008
Location: So Cal
Device: Nook color, prs 505, Axim x30, psp, Acer Aspire One [running xp]
Thanks for all your hard work. I'm downloading it now and will try it out in a bit.
RandallFlagg is offline   Reply With Quote
Advert
Old 04-03-2009, 03:11 PM   #171
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.nrapallo ought to be getting tired of karma fortunes by now.
 
nrapallo's Avatar
 
Posts: 2,958
Karma: 2530691
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200 EBW1150 Device: T1 NSTG iLiad_v2 NC Device: Asus_TF Next1 WPDN
Quote:
Originally Posted by elinares View Post
Finally I've found correct way to descrambling streams in LRF, including images; and also I've corrected many bugs regarding text flow.
@RandallFlag: thanks for the examples
@igorsk:thanks for your info.
Enjoy,
Eladio
Congratulations for improving your .lrf conversion to more portable formats.

Your hard work is truly admirable. Keep up the good work!

A bit of karma coming your way....
nrapallo is offline   Reply With Quote
Old 04-03-2009, 03:59 PM   #172
elinares
Xtreme Quijote
elinares doesn't litterelinares doesn't litterelinares doesn't litter
 
elinares's Avatar
 
Posts: 101
Karma: 208
Join Date: Sep 2008
Location: La Mancha, Spain
Device: Sony PRS-505
Quote:
Originally Posted by bcmartinez View Post
Hello! I'm trying out the PDF2EPUB conversion and I get the following error. Any suggestions?



Thanks!
Bad luck... this exception is thrown in pdfbox library and stops execution. It cannot recognize some ColorMaps and i can not catch Exception and continue, so we must wait for pdfbox boys to found correct maps for some images.
elinares is offline   Reply With Quote
Old 04-07-2009, 10:54 AM   #173
jig
Junior Member
jig began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Apr 2009
Device: itouch
lrf won't convert, NegativeArraySize exception

I get the following trying to convert several books from LRF to EPUB with ver 204.

java.lang.NegativeArraySizeException
at lrf.objects.Book.getMetaData(Book.java:228)
at lrf.objects.Book.<init>(Book.java:113)
at lrf.RecurseDirs.convertAction(RecurseDirs.java:515 )
at lrf.RecurseDirs.convertActionParams(RecurseDirs.ja va:342)
at lrf.RecurseDirs.<init>(RecurseDirs.java:88)
at lrf.RecurseDirs.main(RecurseDirs.java:40)

Have successfully converted many other books (on a Mac). But a few won't convert.

I also have one book that gets the following exception:
java.lang.IndexOutOfBoundsException
at java.nio.Buffer.checkIndex(Buffer.java:520)
at java.nio.DirectByteBuffer.getInt(DirectByteBuffer. java:648)
at lrf.buffer.MappedReader.getInt(MappedReader.java:7 0)
at lrf.objects.Book.loadObjects(Book.java:342)
at lrf.objects.Book.<init>(Book.java:115)
at lrf.RecurseDirs.convertAction(RecurseDirs.java:515 )
at lrf.RecurseDirs.convertActionParams(RecurseDirs.ja va:342)
at lrf.RecurseDirs.<init>(RecurseDirs.java:88)
at lrf.RecurseDirs.main(RecurseDirs.java:40)

It might be possible the files are corrupt as I don't have another method to test their correctness.

Also, many (most? all?) conversions end up with Unknown as author and title and no cover art.

Great set of tools. Any help appreciated.
Thanks.
jig is offline   Reply With Quote
Old 04-07-2009, 11:55 AM   #174
elinares
Xtreme Quijote
elinares doesn't litterelinares doesn't litterelinares doesn't litter
 
elinares's Avatar
 
Posts: 101
Karma: 208
Join Date: Sep 2008
Location: La Mancha, Spain
Device: Sony PRS-505
Quote:
Originally Posted by jig View Post
I get the following trying to convert several books from LRF to EPUB with ver 204.

java.lang.NegativeArraySizeException
at lrf.objects.Book.getMetaData(Book.java:228)

Have successfully converted many other books (on a Mac). But a few won't convert.

I also have one book that gets the following exception:
java.lang.IndexOutOfBoundsException
at java.nio.Buffer.checkIndex(Buffer.java:520)

It might be possible the files are corrupt as I don't have another method to test their correctness.

Also, many (most? all?) conversions end up with Unknown as author and title and no cover art.

Great set of tools. Any help appreciated.
Thanks.
I can tak a look to these books if you pm me.
Eladio.
elinares is offline   Reply With Quote
Old 04-28-2009, 04:37 PM   #175
alxwang
Connoisseur
alxwang began at the beginning.
 
Posts: 96
Karma: 14
Join Date: Mar 2009
Device: Kindle DX, PocketBook 360
How to make this tool works with Chinese?
I convert some Chinese LRF to PDF but all text gone.
I guess it is because Chinese font is not referenced?
Thanks.
alxwang is offline   Reply With Quote
Old 04-29-2009, 03:46 AM   #176
elinares
Xtreme Quijote
elinares doesn't litterelinares doesn't litterelinares doesn't litter
 
elinares's Avatar
 
Posts: 101
Karma: 208
Join Date: Sep 2008
Location: La Mancha, Spain
Device: Sony PRS-505
Quote:
Originally Posted by alxwang View Post
How to make this tool works with Chinese?
I convert some Chinese LRF to PDF but all text gone.
I guess it is because Chinese font is not referenced?
Thanks.
Not sure, Can you pm me a download link for the book?
elinares is offline   Reply With Quote
Old 04-29-2009, 03:58 PM   #177
alxwang
Connoisseur
alxwang began at the beginning.
 
Posts: 96
Karma: 14
Join Date: Mar 2009
Device: Kindle DX, PocketBook 360
One more suggestion - maybe I just do not know how to use it.
When convert to HTML, All of images are name as 1.jpg, 2.jpg....
Can you change it to something like: 00001.jpg, 00002.jpg .... 011011.jpg.
The reason I ask this is because I use this tool to convert comics. DR1000 can display jpg directly but the files sort order got problem.
Thanks.
alxwang is offline   Reply With Quote
Old 04-29-2009, 05:36 PM   #178
elinares
Xtreme Quijote
elinares doesn't litterelinares doesn't litterelinares doesn't litter
 
elinares's Avatar
 
Posts: 101
Karma: 208
Join Date: Sep 2008
Location: La Mancha, Spain
Device: Sony PRS-505
Quote:
Originally Posted by alxwang View Post
One more suggestion - maybe I just do not know how to use it.
When convert to HTML, All of images are name as 1.jpg, 2.jpg....
Can you change it to something like: 00001.jpg, 00002.jpg .... 011011.jpg.
The reason I ask this is because I use this tool to convert comics. DR1000 can display jpg directly but the files sort order got problem.
Thanks.
OK, change commited. Next release will use same lenght names for images.
elinares is offline   Reply With Quote
Old 04-30-2009, 06:24 AM   #179
elinares
Xtreme Quijote
elinares doesn't litterelinares doesn't litterelinares doesn't litter
 
elinares's Avatar
 
Posts: 101
Karma: 208
Join Date: Sep 2008
Location: La Mancha, Spain
Device: Sony PRS-505
Quote:
Originally Posted by alxwang View Post
How to make this tool works with Chinese?
I convert some Chinese LRF to PDF but all text gone.
I guess it is because Chinese font is not referenced?
Thanks.
Please try to convert to html (-html option) and review transformed doc: Has sense to you? I think chinese font must be embedded on pdf...
elinares is offline   Reply With Quote
Old 04-30-2009, 11:01 AM   #180
alxwang
Connoisseur
alxwang began at the beginning.
 
Posts: 96
Karma: 14
Join Date: Mar 2009
Device: Kindle DX, PocketBook 360
HTML works but:
1. Image reference got problem.
2. Random crash about index outbound

Or you can add one more param to let me give you what base font I installed for Chinese?
Then you can use the font I papered to create PDF.
For example:
-basefont "/usr/share/fonts/ttf/
fc-cache/msyh.ttf"

You can just create all font like:
BaseFont.createFont("/usr/share/fonts/ttf/
fc-cache/msyh.ttf", BaseFont.IDENTITY_H,BaseFont.NOT_EMBEDDED);

Thanks

Last edited by alxwang; 04-30-2009 at 11:45 AM.
alxwang is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
A real PDF to epub/djvu/rtf/html software?. DsOft ePub 35 01-02-2011 03:57 PM
PRS-700 Unable to convert pdf to other formats (epub/rtf/doc) testndtv Sony Reader 1 09-24-2010 01:45 PM
How to create non-embedded Unicode EPUB,LRF,TXT,RTF,PDF alexmobile Sony Reader 1 09-23-2009 10:04 PM
Calibre PDF conversions - LRF/EPUB vs RTF jackie_w Calibre 14 09-22-2009 03:06 PM
[Old Thread] unable to convert ebooks(rtf, txt,lit,html,pdf) to lrf in calibre .4.131 jackdeth191 Calibre 9 05-02-2009 02:55 AM


All times are GMT -4. The time now is 08:34 AM.


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