Just noting the 0.4.4 release (I forgot to update this thread for 0.4.3). E-reader mime type handling is working, and a bug involved with running this in CGI is fixed.

Zed,

I'm still having issues with broken mime detection in release 0.4.4.

Code:

WARNING: You don't seem to have a mime-info database.
The shared-mime-info package is available from
http://freedesktop.org/wiki/Software_2fshared_2dmime_2dinfo
Use of uninitialized value in list assignment at script/ebook.pl line 66.

Just noting the 0.4.4 release (I forgot to update this thread for 0.4.3). E-reader mime type handling is working, and a bug involved with running this in CGI is fixed.

Do you handle the UTF-8 coding stuff in MobiPocket files discussed in another thread (problem with multiple bytes characters at record borders)? If your code is handling it I am thinking about using it for mobi2html in MobiPerl.

WARNING: You don't seem to have a mime-info database.
The shared-mime-info package is available from
http://freedesktop.org/wiki/Software_2fshared_2dmime_2dinfo
Use of uninitialized value in list assignment at script/ebook.pl line 66.

Any fix?

Not for broken mime-type detection itself; that's an issue with a different module entirely. However, your e-reader unpacks should now be showing up with the correct mime type, and the API itself allows you to override anything detected.

Do you handle the UTF-8 coding stuff in MobiPocket files discussed in another thread (problem with multiple bytes characters at record borders)? If your code is handling it I am thinking about using it for mobi2html in MobiPerl.

I'm not aware of any failures, but I haven't tested specifically for this issue. Can you link to the other thread, or provide access to a file that decodes incorrectly with other software so I can test it?

I'm not aware of any failures, but I haven't tested specifically for this issue. Can you link to the other thread, or provide access to a file that decodes incorrectly with other software so I can test it?

Most Feedbooks.com .mobi ebooks have this issue since they use UTF-8 encoding. Check this post for the beginning of the discussions regarding this issue. The solution is now documented in our wiki here .

I've included this fix in my Mobi2IMP, but still find the odd (poorly created?) UTF-8 ebooks that still don't find the exact filepos location for the <a href>'s anchor (<a name> or <a id>).

I can't get this tool to work with ActivePerl. Is there any work around to get this to work... is there any way to package this as a stand alone application?

=X=

I got it to work with ActiveState Perl on Windows using v5.8.8 after a long ordeal!

Does it fail on the perl Build.pl with a version error? (my solution was to edit Tools.pm and set version to 0.00 instead of 0.74 and then build it. Afterwards, I re-edited Tools.pm to set the version back to 0.74.

Oh, ya, I also needed some other .pm libs installed before I could get it to finish. Below is a list of the errors I received and the modules I had to install over and above what Zed specifies on CPAN:

Code:

D:\EBook-Tools-0.4.4>perl build.pl
Error evaling version line 'BEGIN { q# Hide from _packages_inside()
#; package Module::Build::ModuleInfo::_version;
no strict;
local $VERSION;
$VERSION=undef;
$vsub = sub {
use version 0.74; our $VERSION = qv("0.4.4");;
$VERSION
};
}' in D:\EBook-Tools-0.4.4\lib\EBook\Tools.pm: version version
0.74 required--this is only version 0 at (eval 19) line 8
BEGIN failed--compilation aborted at (eval 19) line 8, <GEN0> line 6.
failed to build version sub for D:\EBook-Tools-0.4.4\lib\EBook\Tools.pm at C:/Perl/site/lib/Module/Build/ModuleInfo.pm line 309, <GEN0> line 6.
======================================================================
In Tools.pm - changed to: use version 0.0; our $VERSION = qv("0.4.4");
======================================================================
D:\EBook-Tools-0.4.4>perl build.pl
Checking whether your kit is complete...
Looks good
Checking prerequisites...
- ERROR: Config::IniFiles is not installed
- ERROR: Bit::Vector is not installed
- ERROR: version is not installed
- ERROR: String::CRC32 is not installed
- ERROR: Data::UUID is not installed
- ERROR: File::Slurp is not installed
ERRORS/WARNINGS FOUND IN PREREQUISITES. You may wish to install the versions
of the modules indicated above before proceeding with this installation
Creating new 'Build' script for 'EBook-Tools' version '0.4.4'
======================================================================
In Tools.pm - changed to: use version 0.74; our $VERSION = qv("0.4.4");
======================================================================

Not for broken mime-type detection itself; that's an issue with a different module entirely. However, your e-reader unpacks should now be showing up with the correct mime type, and the API itself allows you to override anything detected.

Aside: I noticed a slight issue with the <div style="text-align: center"> running on and not having a properly placed end (</div>) and making all the text afterwards centred. It happened on another large file conversion I tried so don't think it was encoded that way.
The <div> .. </div> pairs match in total numbers, just not closing the "center" properly sometimes. I think it happens when multiple <div> pairs are nested within each other.

After installing all the modules (some from the perl package manager, others by google search), I managed to get build.pl to run correctly
But, when I type ebook, or perl ebook.pl, in command line, I get this error:

The new job has taken up a lot more of my free time than I'd like, but development continues, very slowly. Version 0.4.6 should be showing up on CPAN and Debian Unstable shortly, and improves the dependencies list in the README, as well as flagging EReader HTML output as XHTML. EReader HTML output should also be slightly improved now as well.

Time permitting, my next plans are to try to build a better plugin infrastructure so someone can just drop an extra DRM-handling module into the system and have it work, and double-check on that potential problem with Unicode and boundaries in Mobipocket files that I still haven't had time to create a unit test for.