Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 02-26-2008, 06:28 PM   #346
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: 45,373
Karma: 27230406
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can specify the encoding when using mobigen. I haven't bothered with getting the filepos exactly right since it's not that critical. As long as you make sure you dont insert an anchor inside another <> you're fine.

If I had to guess I'd say filepos represents byte position not character position, since in the cp1252 encoding every character is one byte and that was the original encoding mobigen used, back when it was prcgen.
kovidgoyal is offline   Reply With Quote
Old 02-26-2008, 06:35 PM   #347
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
Quote:
Originally Posted by kovidgoyal View Post
You can specify the encoding when using mobigen. I haven't bothered with getting the filepos exactly right since it's not that critical. As long as you make sure you dont insert an anchor inside another <> you're fine.

If I had to guess I'd say filepos represents byte position not character position, since in the cp1252 encoding every character is one byte and that was the original encoding mobigen used, back when it was prcgen.
I have confirmed that it is byte position. My original test file was corrupt.

Yes, i assume you can just put an anchor somewhere but I wanted to re-use the existing anchor if it existed...
tompe is offline   Reply With Quote
Advert
Old 02-26-2008, 07:08 PM   #348
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
Version 0.0.32 available (no Windows binaries yet)

Verson 0.0.32 is available at

http://www.ida.liu.se/~tompe/mobiperl/

No Windows binaries for this version yet. Feel free to contribute them...

I removed mobi2imp from the distribution since it is distributed in another thread and it is to much work to keep it updated for me. If things stabilize I can put it back if people think it is a good idea.

I added some instruction for Mac on the web site. Please give feedback how to make them better if you try to use them.

Changes in 0.0.32:
  • html2mobi now works if images that are refered to in the html file does not exist.
  • Added flag --fixhtmlbr to html2mobi. This flag will try to fix html files where two <br> have been uses instead of <p></p>.
  • Removed mobi2imp from distribution since it is distributed seperately in MobileRead forum. Duplications are bad and confusing.
  • Fixed so that mobi2html works with utf-8 encoded files.
  • Added meta tag with charset in the html generated by mobi2html.
  • Added instructions of how to install Perl and modules on Mac on the web page.
tompe is offline   Reply With Quote
Old 02-26-2008, 07:57 PM   #349
badgoodDeb
Grand Sorcerer
badgoodDeb ought to be getting tired of karma fortunes by now.badgoodDeb ought to be getting tired of karma fortunes by now.badgoodDeb ought to be getting tired of karma fortunes by now.badgoodDeb ought to be getting tired of karma fortunes by now.badgoodDeb ought to be getting tired of karma fortunes by now.badgoodDeb ought to be getting tired of karma fortunes by now.badgoodDeb ought to be getting tired of karma fortunes by now.badgoodDeb ought to be getting tired of karma fortunes by now.badgoodDeb ought to be getting tired of karma fortunes by now.badgoodDeb ought to be getting tired of karma fortunes by now.badgoodDeb ought to be getting tired of karma fortunes by now.
 
badgoodDeb's Avatar
 
Posts: 8,551
Karma: 64462893
Join Date: Jan 2008
Location: Harrisburg outskirts
Device: Palms, K1-4s, iPads, iPhones, KV, KO1
Oops -- meant to be a PM.

Last edited by badgoodDeb; 02-26-2008 at 07:58 PM. Reason: oops -meant for a PM
badgoodDeb is offline   Reply With Quote
Old 02-26-2008, 08:18 PM   #350
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
Version 0.0.33 available (no Windows binaries yet)

There is a version 0.0.33 now since there was a bug in the utf-8 fix that caused books with codepage 1252 converted to HTML not to be displayed correctly.
tompe is offline   Reply With Quote
Advert
Old 02-26-2008, 08:36 PM   #351
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
Version 0.0.34 available (no Windows binaries yet)

Just so the best version is available if somebody do a Windows version...

I did a 0.0.34 and the change is:
  • png files did not work for html2mobi. Changed so that png files are converted to jpg before it is packed into the mobi file.
tompe is offline   Reply With Quote
Old 02-27-2008, 02:54 AM   #352
Ortep
Fanatic
Ortep has a complete set of Star Wars action figures.Ortep has a complete set of Star Wars action figures.Ortep has a complete set of Star Wars action figures.Ortep has a complete set of Star Wars action figures.Ortep has a complete set of Star Wars action figures.
 
Posts: 527
Karma: 470
Join Date: Sep 2007
Location: The Netherlands
Device: Kindle Oasis
Quote:
Originally Posted by tompe View Post
I have confirmed that it is byte position. My original test file was corrupt.
You were working late. Great job!!!

If there is corruption in the file, it is something that was caused by the software used in creating it. I have 9 others with the same problem.

The corruption has no (direct) effect when I use them on my Cybook.

The only thing I did notice was that the cover was not visible. So that was when I started to experiment with mobi2mobi. And when I didn't like the result I used mobi2html in an attempt to start from scratch.

Perhaps I should contact the writer and tell him about it
Ortep is offline   Reply With Quote
Old 02-27-2008, 05:45 AM   #353
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
Quote:
Originally Posted by Ortep View Post
If there is corruption in the file, it is something that was caused by the software used in creating it. I have 9 others with the same problem.

The corruption has no (direct) effect when I use them on my Cybook.
The only noticeable effect is probably that the links will jump to the wrong file position but you will only notice that if it jumps inside a format tag or something similar and in the case of extra bytes the jump will be too short and then you will probably not notice it.
tompe is offline   Reply With Quote
Old 02-27-2008, 06:50 AM   #354
IceHand
Linux User
IceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavensIceHand is a rising star in the heavens
 
IceHand's Avatar
 
Posts: 323
Karma: 13682
Join Date: Aug 2007
Location: Germany
Device: Kindle 3
Any chance that you'll include huffdic compression support for mobi2html?
IceHand is offline   Reply With Quote
Old 02-27-2008, 09:07 AM   #355
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
Quote:
Originally Posted by IceHand View Post
Any chance that you'll include huffdic compression support for mobi2html?
Maybe. But I would have to convert the code and it is not trivial. If somebody read the Python code and write a "mathematical" specification of the algorithm I would definitely implement it. I saw that kovidgoyal had distributed the code under GPL so I can just choose to trust that he is correct in this. Otherwise I had some concern about the status of the resulting code. I will not do the work if I cannot distribute the code under GPL. A written description of the algorithm would also make totally clear that it is no problem to distribute the code under GPL.
tompe is offline   Reply With Quote
Old 02-27-2008, 09:22 AM   #356
Gudy
Wizard
Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.Gudy ought to be getting tired of karma fortunes by now.
 
Gudy's Avatar
 
Posts: 1,154
Karma: 3252017
Join Date: Jan 2008
Location: Germany
Device: Pocketbook Touch Lux (623)
Quote:
Originally Posted by tompe View Post
Verson 0.0.32 is available at

http://www.ida.liu.se/~tompe/mobiperl/

No Windows binaries for this version yet. Feel free to contribute them...
Here's the Windows binary build for 0.0.34. I once again used HarryT's Sherlock Holmes Omnibus for testing, and something's not right: mobi2html converts the non-breaking space character (& nbsp; / & #xA0; / &# 160; ) into the replacement character (& #xFFFD; / & #65533; ), i.e. the Unicode equivalent of "unknown character".

Also, you may want to add the Encode package both to the installation instructions on your web site and the mh target in the Makefile.
Attached Files
File Type: zip mobiperl-win-0.0.34.zip (7.92 MB, 287 views)
Gudy is offline   Reply With Quote
Old 02-27-2008, 03:22 PM   #357
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
Quote:
Originally Posted by Gudy View Post
Here's the Windows binary build for 0.0.34. I once again used HarryT's Sherlock Holmes Omnibus for testing, and something's not right: mobi2html converts the non-breaking space character (& nbsp; / & #xA0; / &# 160; ) into the replacement character (& #xFFFD; / & #65533; ), i.e. the Unicode equivalent of "unknown character".

Also, you may want to add the Encode package both to the installation instructions on your web site and the mh target in the Makefile.
I had hoped that Encode was included in the core files. Maybe I can try to use another function. I will check with the Sherlock Holmes Omnibus and see what the problem is.
tompe is offline   Reply With Quote
Old 02-27-2008, 03:24 PM   #358
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,792
Karma: 146391129
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
tompe, can you also check your code against purchased Mobipocket eBooks as well?
JSWolf is offline   Reply With Quote
Old 02-27-2008, 03:41 PM   #359
tompe
Grand Sorcerer
tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.tompe ought to be getting tired of karma fortunes by now.
 
Posts: 7,452
Karma: 7185064
Join Date: Oct 2007
Location: Linköpng, Sweden
Device: Kindle Voyage, Nexus 5, Kindle PW
Quote:
Originally Posted by tompe View Post
I had hoped that Encode was included in the core files. Maybe I can try to use another function. I will check with the Sherlock Holmes Omnibus and see what the problem is.
The problem is that this is an old file so it does not have the information about codepage and I had maybe wrongly assumed that if it was not specified it was UTF-8...

I have now changed the code so that if not "codepage" is specified it does nothing. If 1252 is specified it add the meta header for that. If 65001 (UTF-8) is specified I add meta header for that and decode the byte stream with before sending it to HTML::TreeBuilder.

It worked for the Sherlock Holmes omnibus. I will check the UTF-8 example I have and maybe do a new release later today...
tompe is offline   Reply With Quote
Old 02-27-2008, 03:43 PM   #360
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,792
Karma: 146391129
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Please include a Windows edition too.
JSWolf is offline   Reply With Quote
Reply

Tags
mobi2mobi, mobils


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mobi2Mobi Mobi2Mobi v0.13 - GUI for Mobiperl tools Jad Kindle Formats 476 03-15-2015 05:51 PM
Tools for Editing Kindle .mobi Files? GJN Kindle Formats 33 12-26-2013 02:05 PM
Handy Perl Script to convert HTML0 files to smartquotes maggotb0y Sony Reader 0 04-12-2007 11:49 AM
PRS-500 Perl tools to generate Reader content TadW Sony Reader Dev Corner 0 01-08-2007 05:55 AM
gmail copy (gmcp) - Perl script to copy files to/from Gmail Colin Dunstan Lounge 0 09-04-2004 01:24 PM


All times are GMT -4. The time now is 05:27 AM.


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