Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 01-18-2013, 06:32 PM   #16
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: 37,893
Karma: 18755150
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
Quote:
Originally Posted by dgatwood View Post
Sure you can. You can use media queries with screen dimension limits. I can't imagine why you would want to, but you can. Media queries are fully supported by both iBooks and Kindle, as well as nearly all other non-Adobe-based readers.
This is the ePub forum. ADE is the reader that most use to display ePub. Since it doesn't work in ADE, it doesn't work.
JSWolf is offline   Reply With Quote
Old 01-18-2013, 06:33 PM   #17
pdurrant
The Grand Mouse
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 32,911
Karma: 89897838
Join Date: Jul 2007
Location: Norfolk, England
Device: NOOK ST GlowLight
Quote:
Originally Posted by JSWolf View Post
This is the ePub forum. ADE is the reader that most use to display ePub. Since it doesn't work in ADE, it doesn't work.
The real question is whether "media queries" are part of the ePub spec. I haven't checked, but I suspect not.
pdurrant is offline   Reply With Quote
Old 01-18-2013, 06:42 PM   #18
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: 37,893
Karma: 18755150
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
ADE & the ePub 2 spec do not support media queries. I just found the answer on Adobe's support forum and Jim Lester confirmed this.

http://forums.adobe.com/message/4325696?tstart=0
JSWolf is offline   Reply With Quote
Old 01-18-2013, 09:01 PM   #19
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
Posts: 311
Karma: 1028382
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Quote:
Originally Posted by JSWolf View Post
ADE & the ePub 2 spec do not support media queries. I just found the answer on Adobe's support forum and Jim Lester confirmed this.

http://forums.adobe.com/message/4325696?tstart=0
The EPUB 2 specification does not require readers to support any CSS features beyond a subset of CSS2, and ADE does not support very many features outside the required subset (and does not support some of the required subset, either, but again, I digress).

The EPUB 2 specification does require readers to ignore anything that they do not understand, which ADE does not, and thus ADE does not comply with the specification as published.

Quote:
"A conforming Reading System must render all OPS CSS 2.0 required subset properties. A Reading System may support CSS properties beyond the OPS CSS 2.0 required subset, however, any unsupported properties must be gracefully degraded per the CSS 2.0 specification." (OPS 2.0.1 section 1.3.5)
The graceful degradation section says:

Quote:
"A conforming UA must also adhere to the forward-compatible parsing rules, the property and value notation, and the unit notation." (CSS 2.0 spec, Appendix D).
The forward-compatible parsing rules include this:

Quote:
"In some cases, user agents must ignore part of an illegal style sheet. This specification defines ignore to mean that the user agent parses the illegal part (in order to find its beginning and end), but otherwise acts as if it had not been there." (CSS 2.0 spec, Section 4.2)

...

"All levels of CSS -- level 1, level 2, and any future levels -- use the same core syntax. This allows UAs to parse (though not completely understand) style sheets written in levels of CSS that didn't exist at the time the UAs were created. Designers can use this feature to create style sheets that work with older user agents, while also exercising the possibilities of the latest levels of CSS." (CSS 2.0 spec, Section 4.1)
And in particular:

Quote:
"An at-rule consists of everything up to and including the next semicolon ( or the next block, whichever comes first. A CSS user agent that encounters an unrecognized at-rule must ignore the whole of the at-rule and continue parsing after it." (CSS 2.0 spec, Section 4.1.5)
So from the EPUB specification, you can see that @media and @page rules are clearly legal in an EPUB 2.0.1 document. The EPUB spec clearly defines how such rules are to be handled. Specifically, a reader may interpret them, or it may ignore them, at its option, but it must not break.

Last edited by dgatwood; 01-18-2013 at 09:06 PM.
dgatwood is offline   Reply With Quote
Old 01-18-2013, 09:14 PM   #20
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: 37,893
Karma: 18755150
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
It doesn't matter that the spec says to ignore stuff. If epubcheck 1.1, 1.2, aND MAYBE 3.0 flags it as an error, then it won't be put up for sale.

So go put in the media queries to do the image selection based on screen size and see if it actually validates in all those versions of epubcheck.
JSWolf is offline   Reply With Quote
Old 01-18-2013, 09:15 PM   #21
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
Posts: 311
Karma: 1028382
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Quote:
Originally Posted by JSWolf View Post
This is the ePub forum. ADE is the reader that most use to display ePub. Since it doesn't work in ADE, it doesn't work.
The comment I replied to was about iPhone and iPad, so in that context, that's not true for two reasons:

1. From what I've seen, the ADE-compatible readers on iOS appear to be built on top of WebKit rather than Adobe's rendering code, so there is a fair chance that they will handle media queries even though ADE on other platforms does not.

2. It is not a foregone conclusion that most iPhone and iPad users use an ADE-based reader rather than iBooks.

dgatwood is offline   Reply With Quote
Old 01-18-2013, 09:23 PM   #22
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
Posts: 311
Karma: 1028382
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Quote:
Originally Posted by JSWolf View Post
It doesn't matter that the spec says to ignore stuff. If epubcheck 1.1, 1.2, aND MAYBE 3.0 flags it as an error, then it won't be put up for sale.

So go put in the media queries to do the image selection based on screen size and see if it actually validates in all those versions of epubcheck.
Yup. Media queries pass validation in 1.1, 1.2, and 3.0.
dgatwood is offline   Reply With Quote
Old 01-18-2013, 09:53 PM   #23
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: 37,893
Karma: 18755150
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Sony Reader PRS-650, iPad, nook STR
Quote:
Originally Posted by dgatwood View Post
The comment I replied to was about iPhone and iPad, so in that context, that's not true for two reasons:

1. From what I've seen, the ADE-compatible readers on iOS appear to be built on top of WebKit rather than Adobe's rendering code, so there is a fair chance that they will handle media queries even though ADE on other platforms does not.

2. It is not a foregone conclusion that most iPhone and iPad users use an ADE-based reader rather than iBooks.

Bluefire is based on ADE, not WebKit. All the offshoots of Bluefire are based on ADE. Sony's Reader software is based on ADE. I would guess that Overdrive would be based on ADE due to the DRM.
JSWolf is offline   Reply With Quote
Old 01-18-2013, 10:24 PM   #24
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
Posts: 311
Karma: 1028382
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Quote:
Originally Posted by JSWolf View Post
Bluefire is based on ADE, not WebKit. All the offshoots of Bluefire are based on ADE. Sony's Reader software is based on ADE. I would guess that Overdrive would be based on ADE due to the DRM.
I could be wrong, but I thought I was seeing some WebKit-specific bugs in one of those. Maybe not, though.

That said, I just did an experiment, and can confirm that Sony, Bluefire, and Nook on iOS barf on media queries in the same way that ADE does on the desktop, sadly.

Ah. I just figured out which reader it was. Kobo. It's ADE-compatible (as in, it can read EPUB files with ADE DRM), but it uses WebKit for the rendering, supports CSS3 media queries, and even supports fun WebKit-specific variants of CSS3 properties, such as -webkit-border-radius.

Last edited by dgatwood; 01-18-2013 at 10:35 PM.
dgatwood is offline   Reply With Quote
Old 01-19-2013, 12:27 AM   #25
pholy
Booklegger
pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.pholy ought to be getting tired of karma fortunes by now.
 
pholy's Avatar
 
Posts: 1,800
Karma: 7999034
Join Date: Jun 2009
Location: Toronto, Ontario, Canada
Device: BeBook(1 & 2010), PEZ, PRS-505, Kobo BT, PRS-T1, Playbook, Kobo Touch
I don't have a new Kobo reader, so I can't check this, but it may be that the kepub renderer uses webkit, but I'm pretty sure any renderer that understands Adobe DRM has to be using the Adobe renderer. That's what I was told a couple of years ago.
I'm not sure how to create test cases for this either, without going through Kobo's Writing Life and getting both the kepub and DRM'd epub to check and compare.
pholy is offline   Reply With Quote
Old 01-19-2013, 01:56 AM   #26
AnemicOak
Bookaholic
AnemicOak ought to be getting tired of karma fortunes by now.AnemicOak ought to be getting tired of karma fortunes by now.AnemicOak ought to be getting tired of karma fortunes by now.AnemicOak ought to be getting tired of karma fortunes by now.AnemicOak ought to be getting tired of karma fortunes by now.AnemicOak ought to be getting tired of karma fortunes by now.AnemicOak ought to be getting tired of karma fortunes by now.AnemicOak ought to be getting tired of karma fortunes by now.AnemicOak ought to be getting tired of karma fortunes by now.AnemicOak ought to be getting tired of karma fortunes by now.AnemicOak ought to be getting tired of karma fortunes by now.
 
AnemicOak's Avatar
 
Posts: 10,429
Karma: 28936355
Join Date: Oct 2007
Location: Minnesota
Device: HDX 8.9, AuraHD, Nook HD+, Kindle 2,3,T , Opus, Nexus7, iPhone5, etc
Quote:
Originally Posted by pholy View Post
I don't have a new Kobo reader, so I can't check this, but it may be that the kepub renderer uses webkit, but I'm pretty sure any renderer that understands Adobe DRM has to be using the Adobe renderer. That's what I was told a couple of years ago.
IIRC that's correct. They use WebKit for kePub and the RMSDK for ePub (or at least DRM'd ePub's if not all).
AnemicOak is offline   Reply With Quote
Old 01-19-2013, 04:50 AM   #27
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: 6,259
Karma: 4801167
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Just out of curiosity: How would you write a code to select images based on screen size or orientation based on media queries that would degrade gracefully in a theoretical perfectly-ePub-and-only-ePub-compliant reader?
Jellby is online now   Reply With Quote
Old 01-19-2013, 06:02 PM   #28
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
Posts: 311
Karma: 1028382
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Quote:
Originally Posted by Jellby View Post
Just out of curiosity: How would you write a code to select images based on screen size or orientation based on media queries that would degrade gracefully in a theoretical perfectly-ePub-and-only-ePub-compliant reader?
Many ways. For example:


Code:
<div id="myimage"></div>

myimage {
    background-image: .... default image here
}


@media ...
{
    .myimage {
        background-image: ...
        width: ...
        min-width: ...
        height: ...
        min-height: ...
    }
}

or


Code:
<div class="smallDevice"><img src=... /></div>
<div class="mediumDevice"><img src=... /></div>
<div class="largeDevice"><img src=... /></div>

.smallDevice {
    display: none;
}
.mediumDevice {
    display: block;
}
.largeDevice {
    display: none;
}

@media screen and (max-device-width: 720px) {
.smallDevice {
    display: block;
}
.mediumDevice {
    display: none;
}
}


@media screen and (min-device-width: 2000px) {
.mediumDevice {
    display: none;
}
.largeDevice {
    display: block;
}
}
dgatwood is offline   Reply With Quote
Old 01-20-2013, 05:12 AM   #29
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: 6,259
Karma: 4801167
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
Quote:
Originally Posted by dgatwood View Post
Many ways.
"background-image" is not in the list of supported CSS properties in ePub 2.0.1. The other method (selectively disabling with "display: none") would work.
Jellby is online now   Reply With Quote
Old 01-20-2013, 04:11 PM   #30
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
Posts: 311
Karma: 1028382
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Quote:
Originally Posted by Jellby View Post
"background-image" is not in the list of supported CSS properties in ePub 2.0.1. The other method (selectively disabling with "display: none") would work.
My bad. I forgot that EPUB doesn't even support all of CSS 1.0. I swear, every time I work with this stuff, it makes me feel like it's 1996 all over again, and I'm developing code for Netscape 2.0 while trying to maintain backwards compatibility with Netscape Mosaic 0.9b3 and lynx.

*sigh*
dgatwood is offline   Reply With Quote
Reply

Tags
epub, formatting images, image size, images, kindle

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
EPUB -> Mobi = 4x larger file size. (4mb -> 16mb) Muckraker Conversion 20 03-17-2012 11:02 AM
Give me one good reason why I shouldn't sell my DX and buy an iPad ... Sheikspeare Amazon Kindle 106 10-01-2010 03:28 AM
Images too wide for Nook Screen js4c Calibre 7 07-29-2010 05:46 PM
【Best PDF Size】I find The reason of slowing When Read PDF file linlance Sony Reader 0 03-11-2010 09:13 AM
Auto Rotation of Wide Images DoctorOhh Calibre 0 10-15-2009 09:14 PM


All times are GMT -4. The time now is 03:44 PM.


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