View Single Post
Old 05-19-2013, 02:10 PM   #469
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 45,014
Karma: 168808719
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Quexos View Post
Thanks for this code
but I still don't know whether this goes to the css file or maybe that other file with opf extension or elsewhere.
Besides is this standard code or code specific to one ebook. After all one cannot just take the css of one book and copy paste it to another's.
Why ever not? I copy and paste css all the time -- that's how I generated my standard css stylesheet in the first place and how I install it when I'm using Sigil. As for where the image code goes, it is in the first file/chapter of the epub. The preference is to have only that code in the file. The only change needed is to match the height/width numbers to those of image used for the cover.

Quote:
Originally Posted by Quexos View Post
If book publishers and e-readers brands did their job we wouldn't have to bother messing with the code.
The nice thing with ebooks is that if I don't agree with how they did their job, I can change the formatting around to what I prefer.


Quote:
Originally Posted by Quexos View Post
Code:
  <div>
    <svg xmlns="http://www.w3.org/2000/svg" height="100%" preserveAspectRatio="xMidYMid meet" version="1.1" viewBox="0 0 296 475" width="100%" xmlns:xlink="http://www.w3.org/1999/xlink">
      <image height="475" width="296" xlink:href="../Images/cover.jpeg"></image>
    </svg>
  </div>
In the code sample above, replace the 296 with the actual width of the image file and 475 with the height of the image file -- Sigil will show you those number when you open the image file.

If there is not a cover image already being displayed, use Sigil to split the first file at the <body> tag and paste the code into the new file.

You might want to check for various resources for learning about epub formatting around the web. One I like is the Pigs, Gourds and Wikis web site.

Regards,
David

Last edited by DNSB; 05-19-2013 at 02:14 PM.
DNSB is offline   Reply With Quote