View Single Post
Old 12-04-2015, 11:54 PM   #6
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.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Quote:
Originally Posted by eggheadbooks1 View Post
Apple iBooks doesn't read SVG wrappers, at least as far as I know.
iBooks handles SVG wrappers just fine. I use them all the time. Note, however, that by SVG wrapper, we're talking about a standalone HTML file that includes only the image. If you're trying to keep it all in one file, you're likely to have a lot more problems. For example, the cover.xhtml file from my latest book:

Code:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg" xmlns:epub="http://www.idpf.org/2007/ops">
<head>
<title>Cover</title>
<link rel="stylesheet" type="text/css" href="nookstyles.css" />
<link rel="stylesheet" type="text/css" href="nookstyles2.css" />
<style type="text/css">
    html,body {
	height: 100% !important;
	min-height: 100% !important;
	width: 100% !important;
	margin: 0 !important;
	border-width: 0 !important;
	padding: 0 !important;
    }
</style>
</head>
<body style="oeb-column-number: 1; background-color: #000000;" >
<div class="coverpage">
<svg 
	xmlns:svg="http://www.w3.org/2000/svg"
	xmlns="http://www.w3.org/2000/svg"
	xmlns:xlink="http://www.w3.org/1999/xlink"
	version="1.1"
	width="100%"
	height="100%"
	id="svg2"
	xml:space="preserve" viewBox="0 0 2040 2640" preserveAspectRatio="xMidYMid meet">
    <image xlink:href="frontcover.jpg" height="2640" width="2040">
	<desc>Patriots: A Patriots Christmas</desc>
    </image>
</svg>
</div>
</body>
</html>
where the CSS defines this:

Code:
div.coverpage {
        height: 100%;
        margin: 0;
        padding: 0;
        border-width: 0;
}

Quote:
Originally Posted by eggheadbooks1 View Post
And the latest Apple Asset Guide states: "To ensure proper viewing of images in content, use the HTML img tag instead of wrapping images in svg:img."
I just filed rdar://23772057 asking Apple to either remove that paragraph from their documentation or explain what the heck they're talking about. The SVG namespace doesn't have an img tag. The correct tag would be svg:image. So that paragraph borders on pure gibberish, as anything containing an svg:img tag wouldn't even pass epubcheck validation.

I'm guessing this is a case of miscommunication between an engineer and a tech writer who didn't fully grasp the intricacies of XHTML namespaces and other minutiae. Heck, I barely grasp the intricacies of it, and I've been doing this for longer than I care to admit.

Last edited by dgatwood; 12-05-2015 at 12:06 AM.
dgatwood is offline   Reply With Quote