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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 12-23-2007, 05:45 PM   #46
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,054
Karma: 3993884
Join Date: Oct 2007
Location: Link÷png, Sweden
Device: Nexus 7, Nexus 5, iPad 2, Kindle PW
Quote:
Originally Posted by ppxnouse View Post
BTW: Do you know what image types are allowed in a .prc file ? For what images do you check ?
I have assumed that GIF and JPEG is OK. In my html2mobi and lit2mobi programs I convert everything to JPEG. There is a maximum size for the image (64K I think).
tompe is offline   Reply With Quote
Old 12-23-2007, 05:50 PM   #47
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,054
Karma: 3993884
Join Date: Oct 2007
Location: Link÷png, Sweden
Device: Nexus 7, Nexus 5, iPad 2, Kindle PW
Quote:
Originally Posted by ppxnouse View Post
An additional question:

I have a PRC generated by Mobi Reader 6.x beta (from aPDF). The prc does actually contain the cover art as the first image resource. So I patched 201, 202 and 203 in to the EXTH. Set its data to NULL, and expected the gif to show up as cover art in Mobireader. Well. That is not the case. I wonder if MobiReader expects the thmb to be a certain size max and I can not test on a Cybook :-(. Is there anything else that might need to get set ?
On the Cybook only 201 seems to be used and if they do not exist that firstimage is automatically used as cover image. I do not now how the Mobireader works.
tompe is offline   Reply With Quote
 
Enthusiast
Old 12-23-2007, 06:13 PM   #48
ppxnouse
Connoisseur
ppxnouse began at the beginning.
 
Posts: 60
Karma: 10
Join Date: Dec 2007
Location: Aachen
Device: Gen3
Great info, thank you for your help.

Quote:
have assumed that GIF and JPEG is OK. In my html2mobi and lit2mobi programs I convert everything to JPEG. There is a maximum size for the image (64K I think).
I want to show the current artwork, the Cybook would show. So getting the image with offset n can only work if I identify all image resources. Well. For now I just assume there is only gif, png and jpeg, until proven wrong.

Now only my Cybook needs to arrive, so I can see if all works well.

Last edited by ppxnouse; 12-23-2007 at 06:16 PM.
ppxnouse is offline   Reply With Quote
Old 12-23-2007, 06:43 PM   #49
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,054
Karma: 3993884
Join Date: Oct 2007
Location: Link÷png, Sweden
Device: Nexus 7, Nexus 5, iPad 2, Kindle PW
Preliminary mobiperl Windows binaries available

I think I managed to pack html2mobi and mobi2mobi into Windows binaries (using ActivePerl 5.8.8 build 820, PAR-Packer-588.ppd, -M flags to pp). They are available here (version 0.0.13):

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

html2mobi should work with html, opf and lit files. For lit files you need to have clit.exe in your path.

Documentation:

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

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

I did not test so much with lit files on Windows so there might be a problem with images but I assume that people who want to use the programs under Windows give me good bug reports...

All feedback and suggestions for enhancements are welcome.

Last edited by tompe; 12-23-2007 at 06:46 PM.
tompe is offline   Reply With Quote
Old 12-24-2007, 09:25 AM   #50
heyjohn
Member
heyjohn began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Dec 2007
Location: New Hampshire, USA
Device: Cybook Gen3/Palm Zire
Can Mobiperl display and/or change the internal palmDB name of the ebook?

This is for use with oeb:redirect, as documented at http://www.mobipocket.com/dev/articl...ile=URLRef.htm

I would imagine that creating an html file with clever use of oeb:redirect should result in the ability to create custom library orders -- books in a series, sorted by author or publication date, or whatever. (One nifty thought would be organizing the entire Baen Free Library on a Cybook... :-)
heyjohn is offline   Reply With Quote
Old 12-24-2007, 09:42 AM   #51
heyjohn
Member
heyjohn began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Dec 2007
Location: New Hampshire, USA
Device: Cybook Gen3/Palm Zire
Aha, the 'Name:' is actually what I'm looking for, it's the Palm::PDB database name, as opposed to the title or filename. Should be a simple matter to add an option to allow setting a different DB name there (probably wise to keep it to 31 characters plus a NULL).

And thanks for both the program, and for using a scripting language. Were it a binary, I wouldn't have been able to answer my own question...
heyjohn is offline   Reply With Quote
Old 12-24-2007, 04:07 PM   #52
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,054
Karma: 3993884
Join Date: Oct 2007
Location: Link÷png, Sweden
Device: Nexus 7, Nexus 5, iPad 2, Kindle PW
Quote:
Originally Posted by heyjohn View Post
Aha, the 'Name:' is actually what I'm looking for, it's the Palm::PDB database name, as opposed to the title or filename. Should be a simple matter to add an option to allow setting a different DB name there (probably wise to keep it to 31 characters plus a NULL).
I added a flag --databasename to change this name (available in 0.0.15 that can be downloaded now).
tompe is offline   Reply With Quote
Old 12-24-2007, 05:37 PM   #53
heyjohn
Member
heyjohn began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Dec 2007
Location: New Hampshire, USA
Device: Cybook Gen3/Palm Zire
Thanks!

As it turns out, I couldn't get oeb:redirect or oeb:library references to work in HTML on the Gen3 -- so it's not immediately useful for this device. It's possible that other devices (or trying it in .opf files) might have better luck. I'll probably revisit it when I have more time, as it would be very nice to construct customized multi-document guides.
heyjohn is offline   Reply With Quote
Old 12-25-2007, 03:21 AM   #54
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 63,494
Karma: 41548799
Join Date: Nov 2006
Location: UK
Device: PW2, iPad Retina Mini, iPhone 4, MS Surface Pro, Onyx T68, N7,
Quote:
Originally Posted by heyjohn View Post
Aha, the 'Name:' is actually what I'm looking for, it's the Palm::PDB database name, as opposed to the title or filename. Should be a simple matter to add an option to allow setting a different DB name there (probably wise to keep it to 31 characters plus a NULL).

And thanks for both the program, and for using a scripting language. Were it a binary, I wouldn't have been able to answer my own question...
What's the reason for wanting to change the dbname, as a matter of interest?
HarryT is offline   Reply With Quote
Old 12-25-2007, 12:05 PM   #55
DMcCunney
New York Editor
DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.
 
DMcCunney's Avatar
 
Posts: 5,142
Karma: 6210987
Join Date: Aug 2007
Device: Palm TX, Azpen A727 tablet, Fujitsu Lifebook p2110 w/ FBReader
Quote:
Originally Posted by delphidb96 View Post
P.S.
If scripting tools are so wonderful, why do I need so many of them? Ruby, Python, Perl, Javascript, VBscript... Then there's the MS .Net - GAWD!
There is no "one size fits all" scripting language, and there arguably can't be. Each language was developed by different people to address a different set of problems.

Perl was originally written by Larry Wall to perform sophisticated manipulations on text files in Unix. It combines the functionality of several existing tools, including awk, sed, and tr, and quickly became popular with system administrators and others that did a lot of text manipulation. Unix and things like it (Linux, *BSD) use lots of text files to specify the configuration, and utilities that can modify these files with a script rather than manually are a boon.

Javascript is also known as ECMAscript, was originally written by Brendan Eich for Netscape Navigator 3, and originally called LiveScript. Calling it Javascript was an unfortunate Netscape marketing decision which has caused no end of confusion ever since, because people don't realize that Java and Javascript are two completely different things whose only similarity is having Java in the name. Every browser implements JAvascript these days, so if you use a browser, you have it.

Python is a script language created by Guido van Rossum, intended for general programming tasks. While you can manipulate text with it, that's not all it does. One example of stuff written in Python which is relevant here is the parser for Plucker Desktop, that converts HTML files to the form used by Plucker on PDAs.

Ruby is a script language created by a Japanese programmer, designed to address what he saw as lacks in Python.

There are more: if you use Unix/Linux/BSD, there are the script languages implemented by the Bourne, Korn, C, and Bash shells. (The Korn shell language is an upward compatible superset of the bourne shell, the C shell implements a script language with a C like syntax, and the Bash shell attempts to implement the best features of both.) There is also John Ousterhout's TclTk, and from the IBM mainframe environment but ported to other platforms, Michael Colishaw's REXX language.

MS .NET isn't a script language at all -- it's a programming framework implemented as a set of libraries, ala Visual BASIC back when.

For that matter, PCs have had a scripting language since the MS-DOS days: COMMAND.COM implemented a rudimentary script facility used in "batch" files, which has been extended under CMD.EXE in recent Windows versions.

You don't need all of them -- only the ones required by things you do.
______
Dennis
DMcCunney is offline   Reply With Quote
Old 12-25-2007, 01:16 PM   #56
delphidb96
Wizard
delphidb96 ought to be getting tired of karma fortunes by now.delphidb96 ought to be getting tired of karma fortunes by now.delphidb96 ought to be getting tired of karma fortunes by now.delphidb96 ought to be getting tired of karma fortunes by now.delphidb96 ought to be getting tired of karma fortunes by now.delphidb96 ought to be getting tired of karma fortunes by now.delphidb96 ought to be getting tired of karma fortunes by now.delphidb96 ought to be getting tired of karma fortunes by now.delphidb96 ought to be getting tired of karma fortunes by now.delphidb96 ought to be getting tired of karma fortunes by now.delphidb96 ought to be getting tired of karma fortunes by now.
 
Posts: 3,000
Karma: 300001
Join Date: Jan 2007
Location: Citrus Heights, California
Device: TWO Kindle 2s, one each Bookeen Cybook Gen3, Sony PRS-500, Axim X51V
Dennis,

Fine. Just go ahead and let *EVERYONE* know you've had your funny bone removed.

(Me, I would have kept that factiod to myself.)

IOW, I was whining about the unfairness of life, not demanding a precise, thorough and detailed explanation of the (relative and existing solely in the minds of the developers) 'merits' of the various scripting languages and development frameworks.

There, I've stated my motivations clearly so you won't feel the need to expound further.

Derek
delphidb96 is offline   Reply With Quote
Old 12-25-2007, 09:37 PM   #57
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,054
Karma: 3993884
Join Date: Oct 2007
Location: Link÷png, Sweden
Device: Nexus 7, Nexus 5, iPad 2, Kindle PW
mobi2html

I did a version 0.0.16 with a mobi2html program which explodes a DRM-free MobiPocket file into a subdirectory and the resulting HTML file has working links and working images.

For example:
Code:
mobi2html "Bleak House.prc" unpack

Last edited by tompe; 12-26-2007 at 06:59 AM.
tompe is offline   Reply With Quote
Old 12-26-2007, 06:00 PM   #58
heyjohn
Member
heyjohn began at the beginning.
 
Posts: 16
Karma: 10
Join Date: Dec 2007
Location: New Hampshire, USA
Device: Cybook Gen3/Palm Zire
Quote:
Originally Posted by HarryT View Post
What's the reason for wanting to change the dbname, as a matter of interest?
I got a Cybook for my mom for Christmas, and pre-loaded a bunch of Baen Free Library and Baen purchases on it. So I wanted to create a document with blurbs about the various books, and direct links to start reading any given book, using the Mobipocket oeb:redirect and/or oeb:library tags that use the database name of a book.

Unfortunately, I didn't have any luck. Either the Gen3's software doesn't support that feature, or I didn't use it correctly in the original HTML that I wrote that had the blurbs about the books. On the bright side, my mom (who's not a tech enthusiast) seems to really like the Gen3, and is getting some use out of the blurbs even without the direct links.

I'd love to be able to fix the direct links if there's any way to do it -- really nifty feature, and (if there are any Bookeen folks reading) one that can drive gift sales :-)
heyjohn is offline   Reply With Quote
Old 12-28-2007, 10:23 PM   #59
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,054
Karma: 3993884
Join Date: Oct 2007
Location: Link÷png, Sweden
Device: Nexus 7, Nexus 5, iPad 2, Kindle PW
Windows Binaries mobiperl-0.0.17

I packed Windows binaries for version 0.0.17 which can be found here:

http://www.ida.liu.se/~tompe/mobiper...0.0.17-win.rar

I have restructured the code a bit so there is now more binaries:
  • html2mobi - Convert HTML file to a MobiPocket file.
  • opf2mobi - Convert an opf file structure to a MobiPocket file.
  • lit2mobi - Convert a lit file to a MobiPocket file
  • mobi2html - Explode a DRM-free MobiPocket file.
  • mobi2mobi - Manipulate metadata for a MobiPocket file.

The documentation is here:
tompe is offline   Reply With Quote
Old 12-29-2007, 01:14 PM   #60
wallcraft
reader
wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.wallcraft ought to be getting tired of karma fortunes by now.
 
wallcraft's Avatar
 
Posts: 6,979
Karma: 5183568
Join Date: Mar 2006
Location: Mississippi, USA
Device: Kindle 3 and Fire
I used Twain, Mark: Joan of Arc. v1 25 Dec 2007 as a test case. Like all of the PRC files created with BookDesigner, it is a TEXtREAd document.

Under windows using 0.0.17, I was able to add a title and author using mobi2mobi.exe to create a MOBI version. I was also able to replace the small initial BMP image with a larger JPG version using --coverimage. However, the image was not registered as the cover image (e.g. Windows MobiPocket Reader does not have a cover page entry under the contents icon and does not show a thumbnail of the cover image in its eBooks library view).

On the other hand, mobi2html.exe created corrupted images, and running html2mobi.exe on the result of mobi2html crashed in "getBounds" (probably on one of the corrupted images). Also, mobi2html did not seem to support all the options in its documentation. For example, --coverimage with no argument did not work and neither did --mobifile MOBIFILE and --htmlfile HTMLFILE.

For Windows at least, it would be useful if mobi2html could add a filename extension to the images (e.g. record-7307489.bmp instead of just record-7307489). This requires detecting the image type, but even the wrong image type filename extension would probably be better than no extension.

For the particular case of BookDesigner .prc files, it would be a nice addition to mobi2mobi if the Table of Contents near the start could be used as the basis for a formal TOC. Then, mobi2mobi would become the easiest way to enhance all the existing .prc files in the Mobi/PRC Books Forum to fully functioning version 4 MOBI files.

I attach the corrupted image from mobi2html and a 3x magnified JPEG version of the correct BMP file (to use as a test cover). In many cases, the creators of the .prc version will have better large images to use as the cover than this.
Attached Thumbnails
Click image for larger version

Name:	cover.jpg
Views:	390
Size:	55.0 KB
ID:	8542  
Attached Images
File Type: bmp record-7307489.bmp (46.8 KB, 394 views)
wallcraft is offline   Reply With Quote
Reply

Tags
mobi2mobi

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mobi2Mobi Mobi2Mobi v0.13 - GUI for Mobiperl tools Jad Kindle Formats 461 03-26-2014 12:59 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 12:34 AM.


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