View Full Version : Bad Value Attribute "PreserveAspectRatio"


stevej46
08-03-2011, 11:17 PM
It seems I have one last error to fix before I can upload my book.


ERROR: /Users/Steve/Calibre Library/Stephen H. Johnson/I In Florida (45)/I In Florida - Stephen H. Johnson.epub/OEBPS/Text/titlepage.xhtml(22): bad value for attribute "preserveAspectRatio"

Here is the title page code:

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" xmlns:xml="http://www.w3.org/XML/1998/namespace">
<head>
<meta content="true" name="calibre:cover" />

<title>Cover</title>
<style title="override_css" type="text/css">

/*<![CDATA[*/

@page {padding: 0pt; margin:0pt}
body { text-align: center; padding:0pt; margin: 0pt; }
/*]]>*/
</style>
</head>

<body style="">
<div>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="100%" preserveAspectRatio="none" version="1.1" viewBox="0 0 500 751" width="100%">
<image height="751" width="500" xlink:href="../Images/cover.jpeg"></image>
</svg>
</div>
</body>
</html>

I've tried putting my own title page in the InDesign format.. I've also tried adding the cover photo from Calibre in the metadata area. Always get the some error.

What am I doing wrong?

Stevej46

JSWolf
08-03-2011, 11:21 PM
<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="calibre:cover" content="true"/>
<title>Cover</title>
<style type="text/css" title="override_css">
@page {padding: 0pt; margin:0pt}
body { text-align: center; padding:0pt; margin: 0pt; }
</style>
</head>
<body>
<div>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="100%" height="100%" viewBox="0 0 510 680" preserveAspectRatio="xMidYMid meet">
<image width="510" height="680" xlink:href="coverh4a200033db.jpg"/>
</svg>
</div>
</body>
</html>

Replace the resolution with your images and replace the image name with your own.

charleski
08-04-2011, 12:24 PM
Make sure 'Preserve aspect cover ratio' is checked in calibre's epub output options.

JSWolf
08-04-2011, 12:35 PM
Make sure 'Preserve aspect cover ratio' is checked in calibre's epub output options.

The code I posted is from Calibre with the proper aspect ratio for the cover image.

stevej46
08-06-2011, 02:43 PM
Make sure 'Preserve aspect cover ratio' is checked in calibre's epub output options.

It worked fine once I did check the box in Calibre Output Options.

Thanks,

I have my first book published on Lulu.com now.

Stevej46

BearMountainBooks
03-31-2013, 12:45 PM
Make sure 'Preserve aspect cover ratio' is checked in calibre's epub output options.

Thanks for this. :thanks: