View Single Post
Old 01-30-2021, 10:50 AM   #1
413Michele
Enthusiast
413Michele began at the beginning.
 
Posts: 47
Karma: 10
Join Date: Jan 2021
Location: Italy
Device: Kobo Libra 2, Kindle Paperwhite (1st gen)
Google Play Books and a CSS-specific error

Hello!

I'm writing this post to share something I discovered and hopefully understand styles a bit more than before.

I have a calibre collection that from time to time I manually sync to Google Play Books to read on the go; yesterday I tried to add a new (perfectly working in calibre) EPUB3 file to Play Books, only to get a generic "Upload failed" error.

This without any debug information, but hey, it's Google...

I read the help page here and I checked my file with epubcheck, which gave me this error:

Code:
ERROR(RSC-005): ./filename.epub/OEBPS/Text/cover.xhtml(22,58): Error while parsing file: value of attribute "height" is invalid; must be an integer
This was related to this line in the cover.xhtml file in the book, specifically to this line:

Code:
<img alt="" height="100%" src="../Images/cover.jpg"/>
Now, I don't really know HTML and CSS apart from the basics, so I found that another EPUB I had used this construction, which seemed pretty identical to me in its effects:

Code:
<img src="images/cover.jpg" style="height: 100%;"/>
So I took that line, put it in place of the first with the calibre Editor and uploaded the file.

Ta-da! Google accepts the file without any problem.

I've written this for two reasons:
  • To document a problem that is not so easy to debug, given the lack of info from Google during the upload process
  • Because I don't understand the error.


What is wrong with the first way of using the height tag? I have at least a few books that use it, with no problems from the calibre viewer and Adobe Digital Editions. If somebody could explain it to me it'd be very helpful
413Michele is offline   Reply With Quote