View Single Post
Old 02-22-2018, 11:04 PM   #11
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by odamizu View Post
What is the benefit of wrapping a cover jpg (or any image) in SVG code? I've seen ebooks with cover images without SVG; and other ebooks wrap the cover jpg in SVG. SVG also seems to be the default for Sigil and Calibre.
As others have mentioned, the SVG Wrapper allows the underlying image to stretch/expand without distortion.

This differences really stand out when you have Tall/Skinny or Fat/Short images, OR you turn your device from Portrait->Landscape.

For example:

Example 1 (SVG Wrapper vs. HTML Width) [Portrait]

You can see the SVG Wrapper stays the proper ratio:

Click image for larger version

Name:	Example1-SVGWrapper[Portrait].jpg
Views:	473
Size:	104.2 KB
ID:	162466

but the HTML version that stretches to "100% width/height of the screen" starts turning into an oompa loompa:

Click image for larger version

Name:	Example1-HTMLWidth[Portrait].jpg
Views:	470
Size:	122.0 KB
ID:	162467

Example 2 (SVG Wrapper vs. HTML Width) [Landscape]

The problem becomes much worse when you turn the device to landscape.

You can see the SVG Wrapper keeps the ratio correct:

Click image for larger version

Name:	Example2-SVGWrapper[Landscape].jpg
Views:	413
Size:	44.4 KB
ID:	162468

but the HTML Width+Height version gets severely distorted:

Click image for larger version

Name:	Example2-HTMLWidthHeight[Landscape].jpg
Views:	432
Size:	77.2 KB
ID:	162469

while the HTML Width version gets chopped off and flies off the screen:

Click image for larger version

Name:	Example2-HTMLWidth[Landscape].jpg
Views:	441
Size:	56.8 KB
ID:	162470

Quote:
Originally Posted by j.p.s View Post
I don't know whether SVG images can cause problems with KF8, but I do know that SVG images that are actually made with vectors instead of pixels can look great in KF8 books.
But sadly, SVGs don't work in old MOBI. So you would have to create fallback images anyway. A real giant pain.

I still recommend having the SVG sources though, so in the future you could generate higher quality/resolution images (like in my Formulas to PNG tutorial).

Though an absolutely fantastic post you referenced if I do say so myself.

Last edited by Tex2002ans; 02-22-2018 at 11:13 PM.
Tex2002ans is offline   Reply With Quote