View Full Version : Epub mostly black - faulty epub!


mrmikel
09-15-2009, 03:01 PM
I was reading Last Secrets, a John Buchan book, which lead me on to Mount Everest, a reconnaissance, which is available at Google books as an epub.

Knowing the book is going to have several errors, I bring it up in Sigil and all that shows are the early table of contents pages and the rest is all black.

I switch to code view and Google had set the background to BLACK!!!! Black text on a black background is not readable.

Editing background to white while in code view and it is just fine now.

Posting to help others who get a similar epub from Google.

Valloric
09-15-2009, 04:21 PM
I switch to code view and Google had set the background to BLACK!!!! Black text on a black background is not readable.

This is unfortunately not a problem with the book from Google, but a problem with Sigil. As a recent poster encountered (http://www.mobileread.com/forums/showthread.php?t=56620) as well, CSS styles applied to particular flows of a book (e.g. the black background for covers on many Google epubs) will be applied to the entire flow being edited in Sigil.

While this problem will go away in 0.2.0, I'm thinking of implementing a stop-gap measure for the next (0.1.4) release. That is, to not copy flow-specific CSS into Sigil.

I'd like to hear other people's thoughts on this.

mrmikel
09-16-2009, 07:42 AM
It seems there is almost no situation in which a black background is required in using a book. In fact, I think it is just an artifact of the scanning process. That part which is not book cover or paper is black.

So I can't see any reason why, for a black and white Sony Reader at least, that you couldn't just delete background colors altogether or set them to white and set text to black.

I see your problem...it is like merging a whole series of web pages and whatever is at the top is going to govern as far as CSS goes.

Maybe the solution is to comment it out and allow anyone editing to put it back at their leisure.

Valloric
09-16-2009, 08:25 AM
It seems there is almost no situation in which a black background is required in using a book. In fact, I think it is just an artifact of the scanning process. That part which is not book cover or paper is black.

So I can't see any reason why, for a black and white Sony Reader at least, that you couldn't just delete background colors altogether or set them to white and set text to black.

Oh I completely agree with this, but it still stands that the background is black only on the cover, and not on the rest of the book.

mrmikel
09-16-2009, 11:37 AM
How about just commenting it out, then they could put it back bit by bit?

Valloric
09-16-2009, 12:18 PM
How about just commenting it out, then they could put it back bit by bit?

Commenting it out would require recognizing the style. That would require writing a CSS parser, and if I do that, I may as well implement a CSS rewriter. And there's no point in doing that now that I've decided to switch Sigil to multi-flow editing.

So I'm probably going to implement the stop-gap. It would stay in place until 0.2.0, and so flow-specific CSS would not be copied.

khalleron
09-16-2009, 12:53 PM
Commenting it out would require recognizing the style. That would require writing a CSS parser, and if I do that, I may as well implement a CSS rewriter. And there's no point in doing that now that I've decided to switch Sigil to multi-flow editing.

So I'm probably going to implement the stop-gap. It would stay in place until 0.2.0, and so flow-specific CSS would not be copied.

I'm for that, although HTML newbie me figured out what was wrong and how to fix it, so I doubt it's that big a problem for those (pretty much everyone) more knowledgeable than I.

But one less step, sure.

Would this take care of the every paragraph having it's own unique class identifier problem? Such as this file (http://books.google.com/books?id=Fgs7AAAAMAAJ&printsec=frontcover&dq=at+the+back+of+the+north+wind#v=onepage&q=&f=false).

I gave up on that one.

Kate

mrmikel
09-16-2009, 01:28 PM
I see what you mean now by your stopgap.

EPUB is not yet at a stage where eliminating the flow formatting is going to make much difference especially when the hardware can't even do justified text or follow backward links.

The stop gap sounds great.

When I knocked out all the flow statements the text became centered so I had to fix the css to text align: left.

I had to center the title after that but that was it.

If I use your software in the first place I will be doing far more than that anyway fixing misspellings, hard spaces and formatting around pictures.

Thank you for work on this great software. Before I was using XML mind which did the job, but took forever and made you jump back and forth to correct the simplest error.

Valloric
09-16-2009, 02:48 PM
Would this take care of the every paragraph having it's own unique class identifier problem? Such as this file (http://books.google.com/books?id=Fgs7AAAAMAAJ&printsec=frontcover&dq=at+the+back+of+the+north+wind#v=onepage&q=&f=false).

I can't download the book you linked, so I'm not sure what you are getting at.

khalleron
09-19-2009, 09:57 PM
OK, I re-downloaded a new copy, and it doesn't have the problem. The copy I had tried to work on had been run through Calibre - not formatted, merely added to the library, but it apparently added a lot of junk to the code.

I'll continue to work on the 'good' copy.

Valloric
09-20-2009, 06:22 AM
The copy I had tried to work on had been run through Calibre - not formatted, merely added to the library, but it apparently added a lot of junk to the code.

Wait, so calibre will mess with an epub file even if it's just imported into the library for transfering onto the Reader? I did not know this. Thanks for pointing it out.

HarryT
09-20-2009, 11:26 AM
Wait, so calibre will mess with an epub file even if it's just imported into the library for transfering onto the Reader? I did not know this. Thanks for pointing it out.

AFAIK it only does so if you do something to the book, such as edit the metadata. If you simply import it, I don't believe it will touch the file; it just stores it.

Valloric
09-20-2009, 11:42 AM
AFAIK it only does so if you do something to the book, such as edit the metadata. If you simply import it, I don't believe it will touch the file; it just stores it.

That's what I thought it did. But for a moment there...