Fixing ebooks with errors – A personal challenge

I have wholly embraced the eBook revolution. As a long time traveler, and SciFi aficionado, I have assembled a large collection of books that I continue to read to mark them off my to do list.

Being a fan of science fiction, I have been forced to acquire some of my books by extra-legal means. Since many of the classic tomes of the golden era of SciFi are out of print, and have no official ebook release to buy, I turn to the internet.

With few exceptions, these books are scanned and OCR’d from print, and then stuffed into a file to read. Lots of early Heinlien, and obscure authors exist only this way.

The problem, OCR still sucks.  Even the best algorithms barf a lot on text and thus there are spots of garbage in many of these books.

I sometimes make it a personal mitzvah to clean up a book.

Classic example was the “To the Stars” trilogy, by Harry Harrison (his real name, not a nom de plume). It was a rather poor scan and conversion to an RTF file. It was a painful process to fix, but totally worth it, because it made the book completely readable.

However, if your book is in ePub of PDF format, you have fewer options.

Sigil, a pretty awesome open source ePub editor
Sigil, a pretty awesome open source ePub editor

The program I go to is Sigil. Provided there is no DRM, you can open and inspect the book, and fix small things. If you are savvy, you can also dive into the CSS stylesheet and alter fonts, indents, and other text properties (but be warned, some readers ignore much of the CSS codes and classes – I’m looking at you Sony Reader).

Sigil allows you to look at the text as it renders, at a split screen with the code below the rendered text, or just pure code. You can fix a lot of errors and glitches with the search and edit the code, saving back to the original file.

A future series of posts will go into depth on how to better structure the ebook.

Another good program, and one that is widely used Calibre. A library, and file manipulation program, it is open source and extensible. It makes it easy to convert from one format to another (Kindle to ePub, or LRM to ePub, and many other options.)

A nice touch is that in Calibre you can better setup the ISBN, the cover images, and get data on the book from public databases. I used Calibre to convert a collection of Doc Savage stories from the lrm format (the original Sony Reader format) to ePub, and to add good cover pictures.

In fact, most of the ebook files I look at in Sigil have signs of being converted/cleaned by Calibre, even some commercial books.

Doing this work, you find some things like:

  • Files which came from Microsoft Word – littered with the “class=msonormal” tag. Ugh. I don’t usually curse too much about microsoft office, but what it outputs for HTML that is converted into an ebook is a crime against humanity.
  • Most ebooks, even commercial, professionally edited and assembled ones, have horrible structure. Not proper links to the chapters, nor proper tables of contents. Commercial books are much more likely to get this right, but it is a disaster on the community sourced works. I am working up a process to fix that.
  • There are some truly shitty OCR engines out there. Even high priced, high performance engines have trouble, the second tier is atrocious. Someone once grumbled on Slashdot why there weren’t any good (free) open source OCR engines, and the answer is that because it is friggin hard, and it often becomes a lifetime’s work to tune and improve the algorithm, so the good ones are not in a hurry to be given away.

I rarely make a mission to fix an ebook, but when I do, I want to leave something that is a better experience to read.

(For the record, if there is a place to buy a book, I will always buy it, but much of what I read is esoteric, or out of print, so I am forced into alternatives. )

I thought I could live with iPhoto

As part of my migration to a MacBook Air (from my macbook pro with beaucoup disk space) I figured I would just live with the “as delivered” iPhoto.
Alas, that was not to be. I did one (small) import of photos, and I about barfed. For a program that takes about 1.5 G of disk space, it pretty much sucks when you are used to using Aperture. iPhoto lacks a lot of what I have come to expect in my photography workflow with Aperture.
iPhoto is great for built in software and casual users, but I moved away from it 3 or 4 years ago when my photo library became 60G’s of space on my disk (now it is well over 150G).
The tools for managing, cataloging, creating light boards, and albums/collections are addictive to serious photographers (I am sure there are better tools, but I am a hack, and I just like tools that work for me.
The real dilemma I have is do I buy (rent) a copy of Photoshop CC.
Fortunately, it was pretty easy to move it over and to get it properly licensed here.
So far, I am loving the MBA. I am on my third day since I charged it and I still have plenty of juice in the battery. It is astounding how liberating it is to not need to charge often. With my MacBook Pro, after an hour or so, I was looking for a spare socket to charge it.