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-30-2021, 10:50 AM   #1
413Michele
Enthusiast
413Michele began at the beginning.
 
Posts: 44
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
Old 01-30-2021, 01:14 PM   #2
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
<img height=...> is HTML, <img style="height:..."> is CSS (I mean the height part is CSS).

In HTML height is a number, in pixels, don't use it. In CSS height can have many units.
Jellby is offline   Reply With Quote
Advert
Old 01-30-2021, 01:30 PM   #3
413Michele
Enthusiast
413Michele began at the beginning.
 
Posts: 44
Karma: 10
Join Date: Jan 2021
Location: Italy
Device: Kobo Libra 2, Kindle Paperwhite (1st gen)
Quote:
Originally Posted by Jellby View Post
<img height=...> is HTML, <img style="height:..."> is CSS (I mean the height part is CSS).

In HTML height is a number, in pixels, don't use it. In CSS height can have many units.
Understood, thanks

Thinking back I think I caused the problem by updating from EPUB2 to EPUB3 with calibre, it left behind some tagging problems.

Later I dug some more in my files and I found similar "update caused" problems like in table borders (e.g. a table can't have the HTML tag border=0 anymore) and in the alt="" inside an <svg><image> tag, that was considered wrong in EPUB3 but not in EPUB2.

I resolved them manually, but I wonder if I should point them out in the calibre bug tracker, as their origin is probably the book editor. There are problems only with strict interpreters like Google Play Books though, so it's not very important
413Michele is offline   Reply With Quote
Old 01-30-2021, 06:12 PM   #4
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,156
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Also use a real Android App, not Google Playbooks, which is tied to the Playstore and requires the Google Framework. It's not a standalone Android App.
Lithium is far better.
I only use Playbooks for books FROM Google.
Quoth is offline   Reply With Quote
Old 01-31-2021, 01:56 PM   #5
413Michele
Enthusiast
413Michele began at the beginning.
 
Posts: 44
Karma: 10
Join Date: Jan 2021
Location: Italy
Device: Kobo Libra 2, Kindle Paperwhite (1st gen)
Quote:
Originally Posted by Quoth View Post
Also use a real Android App, not Google Playbooks, which is tied to the Playstore and requires the Google Framework. It's not a standalone Android App.
Lithium is far better.
I only use Playbooks for books FROM Google.
The thing is, I really like having synced books and reading point that Play Books offers, even if it means not having advanced options. I quite like their font, Literata, so it's a nice solution for me. I looked up Lithium though and I like it so thank you for the info, I'll give it a try
413Michele is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CSS in Google Play Books vs Nook and others codys ePub 8 07-19-2019 09:47 PM
ADE and Google Play Error Apparition B5 General Discussions 15 06-08-2018 07:56 AM
Kindle Previewer: error converting from epub with specific CSS and `display: none` arthurattwell Kindle Formats 3 08-10-2016 08:42 AM
Epub3 CSS not implemented on Google Play Books leijoninna ePub 0 04-11-2014 08:45 AM
Google play download unsuccessful error Dingo enTourage eDGe 1 04-04-2012 12:31 PM


All times are GMT -4. The time now is 04:10 PM.


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