Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 01-17-2018, 01:52 PM   #1
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Weird "check" message in Calibre editor for ePUB

Hey, kids:

So, I had a client with 7 offshore-built ePUBs come to me, asking me to fix them so that they could be sold at B&N, etc. None pass ePUBcheck.

Most of it was easy-peasy; someone used an xml file extension for the cover page, or did some other daft thing. BUT, I got this doozy of an error, on almost all of them:

Quote:
ERROR: CSS: PropertyValue: Missing token for production Choice(ColorValue, Dimension, URIValue, Value, variable, MSValue, CSSCalc, function): ('HASH', u'#00007', 1, 107)****[OEBPS/cover.xhtml]
I've never seen this before. Nor do I have a freaking clue as to what it might be. With the notation about the color values, I thought, well, crap, maybe it's something in the cover image, itself, but removing it and replacing it did not change the reported error.

n.b.: this error/warning/whatever does not show up in ePUBcheck 2.01 proper. It only shows up in the Calibre "check." (Whatever that is). As you can tell, I don't use C's editor very often; I'm a Sigil girl at heart. But when you work with offshored ePUBs, the file structure is different than Sigil creates, so it's best to use Calibre for that, which won't rearrange their existing structure. Thus, I got that doozy.

It sounds to me like a problem with the hashes, but...Whiskey Tango Foxtrot, what is that? I don't have to fix it, as it doesn't show up for ePUBcheck, but...you know. Inquiring Minds...

I thought that you lads--my rave fave steely-eyed coding pilots--might know. I'm most curious.

Thoughts?

Hitch
Hitch is offline   Reply With Quote
Old 01-17-2018, 01:57 PM   #2
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: 73,970
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Why are you using an outdated epubcheck? The current version is 4.0.2.

As for the error, can you please post cover.xtml along with any relevant CSS code? Thanks.

Last edited by JSWolf; 01-17-2018 at 02:04 PM.
JSWolf is offline   Reply With Quote
Old 01-17-2018, 02:03 PM   #3
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,212
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
If you click (or is it double-click ???) the calibre Editor error message it should take you to the actual CSS rule it doesn't like.

This is only a wild guess... but is it anything like
Code:
{color: #00007; ...}
If so, I thought RGB colours defined with a # needed to be #3-dgt or #6-dgt not #5-dgt as in that message you got.

Last edited by jackie_w; 01-17-2018 at 02:06 PM.
jackie_w is offline   Reply With Quote
Old 01-17-2018, 02:54 PM   #4
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by JSWolf View Post
Why are you using an outdated epubcheck? The current version is 4.0.2.
Sorry--I mistyped, or, rather, misspoke. I'm using ePUB version 2.01 rules, and yes, I'm using 4.0.2 to validate. Can we focus on the oddball message?

Quote:
As for the error, can you please post cover.xtml along with any relevant CSS code? Thanks.
I sh*t thee not, there's nothing to see, but...I'll grab that if you want to see it. I've resolved this, now, but the language of the message was weird.

Quote:
Originally Posted by jackie_w View Post
If you click (or is it double-click ???) the calibre Editor error message it should take you to the actual CSS rule it doesn't like.

This is only a wild guess... but is it anything like
Code:
{color: #00007; ...}
If so, I thought RGB colours defined with a # needed to be #3-dgt or #6-dgt not #5-dgt as in that message you got.
I decided it wasn't worth aggravating myself, and nuked the background color declaration (for the body, who knows what they were thinking, putting in a background color for a COVER???), and that "solved" the weirdo message. Apparently, yes, it was the color call. I should have thought about it, but the oddity of the error message threw me.

Hitch
Hitch is offline   Reply With Quote
Old 01-17-2018, 03:25 PM   #5
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: 73,970
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Sometimes a background color of black is used so all you see is the cover. Can you show how you had this background color set when you did get the error?
JSWolf is offline   Reply With Quote
Old 01-23-2018, 10:22 AM   #6
thinkulum
Junior Member
thinkulum began at the beginning.
 
Posts: 2
Karma: 10
Join Date: May 2012
Device: iPod touch
Quote:
Originally Posted by Hitch View Post
ERROR: CSS: PropertyValue: Missing token for production Choice(ColorValue, Dimension, URIValue, Value, variable, MSValue, CSSCalc, function): ('HASH', u'#00007', 1, 107)****[OEBPS/cover.xhtml]
I think the error is generated by the Python library cssutils, which Calibre uses. "Missing token for production" shows up here. It's the kind of language parsers use.

A parser interprets a file based on a formal grammar that expects certain chunks of text (or other data) in certain orders. A token is a combination of one of those chunks and a name that identifies its category so the parser knows what to do with it. A production is one of the rules of the grammar.

So in this case it looks like the parser figured out it was looking at a property, but then instead of something matching the kinds of property value it was expecting (something from the list in Choice), it found "#00007."

Ideally I think Calibre should translate errors like that into something more readable instead of just passing them along to the user.
thinkulum is offline   Reply With Quote
Old 01-24-2018, 12:05 AM   #7
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by thinkulum View Post
I think the error is generated by the Python library cssutils, which Calibre uses. "Missing token for production" shows up here. It's the kind of language parsers use.

A parser interprets a file based on a formal grammar that expects certain chunks of text (or other data) in certain orders. A token is a combination of one of those chunks and a name that identifies its category so the parser knows what to do with it. A production is one of the rules of the grammar.

So in this case it looks like the parser figured out it was looking at a property, but then instead of something matching the kinds of property value it was expecting (something from the list in Choice), it found "#00007."

Ideally I think Calibre should translate errors like that into something more readable instead of just passing them along to the user.
I played with it a bit, and managed to nuke it. Somehow, whomever had built the original ePUB had coded a background "color" for the cover page (nope, don't know why). That caused the issues. I simply nuked it, rather than puzzling out the whys and wherefores of the coding. The client was paying SOLELY to "fix" the ePUBs, which did not pass ePUBcheck, so..clean file was my only goal.

Thanks for the insight. I've saved the thread and your comments to delve into another time when I have some time for that type of fun investigation.

Hitch
Hitch is offline   Reply With Quote
Old 01-24-2018, 05:27 AM   #8
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: 73,970
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I've seen ePubs with a background color. It there so the cover is on a white or black background.

Yes, it gets flagged as an error, but it works with ADE.
JSWolf is offline   Reply With Quote
Old 01-24-2018, 12:54 PM   #9
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by JSWolf View Post
I've seen ePubs with a background color. It there so the cover is on a white or black background.

Yes, it gets flagged as an error, but it works with ADE.
Well, I guess that's great if you're formatting your own book, but not so brilliant for commercial production, then.

Thanks, Jon.

Hitch
Hitch is offline   Reply With Quote
Old 01-24-2018, 05:40 PM   #10
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,094
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
I fall into the "formatting your own book" category and use background color for my covers all the time. I set it as an inline style of the body with an svg wrapper of the jpg/png image. I use the latest epubcheck with no problems???

<body style="margin:0; padding:0; color:black"> 'or some other color complementary to the image
Turtle91 is offline   Reply With Quote
Old 01-24-2018, 07:37 PM   #11
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by Turtle91 View Post
I fall into the "formatting your own book" category and use background color for my covers all the time. I set it as an inline style of the body with an svg wrapper of the jpg/png image. I use the latest epubcheck with no problems???

<body style="margin:0; padding:0; color:black"> 'or some other color complementary to the image
Um...not sure I still have the originals, but I'll see. If I do, happy to show you what it had.

H
Hitch is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calibre-generated epub (from .docx) gives "e21027" "multiple opf files" on KindleGen GhostRider Conversion 0 12-22-2017 09:06 AM
What does "Well-formed Check Epub" do? Gregg Bell Sigil 3 09-14-2017 11:10 PM
Calibre Editor keeps switching language metadata to "es" gjbalzano Editor 3 08-03-2017 10:19 PM
Bugs "Sanity Check epub" and "Failed Release date" on V 0.91 qkiazd Sigil 5 12-03-2015 04:01 AM
epub check tells me "Version not found" in my content.opf NASCARaddicted ePub 4 01-26-2013 08:10 AM


All times are GMT -4. The time now is 04:00 AM.


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