Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 02-25-2020, 03:05 PM   #1
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
html img tag versus svg wrapped image tag

1) Why do some books use an html img tag for the cover page while Calibre's cover page generator, Calibre's Generate Cover plugin, and Sigil all use the svg wrapped image tag? (With an img tag Calibre's editor's preview window shows it full size with scroll bars when the image is too big for the window while Sigil's preview window and Calibre's reader resize it to fit the window.)

2) In the body of a book what are the advantages or disadvantages to using an svg wrapped image tag versus an html img tag? Complexity of the svg method is probably one disadvantage with it. I've never seen this done so I'm assuming that the advantages aren't there.
hobnail is offline   Reply With Quote
Old 02-25-2020, 06:06 PM   #2
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
SVG wrapped images will be able to fill the screen without distorting the aspect ratio. Great for full page images like cover/title/maps.

Some devices don't like svg in anything except the cover. Also, if you want an embedded image that doesn't take up the whole page, I would just style a div as a container.

There are several discussions of this topic on MR if you do a quick search.
Turtle91 is offline   Reply With Quote
Advert
Old 02-25-2020, 07:31 PM   #3
Hitch
Bookmaker & Cat Slave
Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.Hitch ought to be getting tired of karma fortunes by now.
 
Hitch's Avatar
 
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
Quote:
Originally Posted by Turtle91 View Post
SVG wrapped images will be able to fill the screen without distorting the aspect ratio. Great for full page images like cover/title/maps.

Some devices don't like svg in anything except the cover. Also, if you want an embedded image that doesn't take up the whole page, I would just style a div as a container.

There are several discussions of this topic on MR if you do a quick search.
And if you're making a file that will find its way to Amazon/Kindle, you cannot assume that the device upon which your book will end up can handle SVG at ALL.

Hitch
Hitch is offline   Reply With Quote
Old 02-25-2020, 11:18 PM   #4
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,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by hobnail View Post
1) Why do some books use an html img tag for the cover page while Calibre's cover page generator, Calibre's Generate Cover plugin, and Sigil all use the svg wrapped image tag?
See my 2018 post in "SVG images - why?".

Also read the rest of the discussion in that thread.

Quote:
Originally Posted by hobnail View Post
2) In the body of a book what are the advantages or disadvantages to using an svg wrapped image tag versus an html img tag? Complexity of the svg method is probably one disadvantage with it.
If you're making it for Amazon... don't use the SVG-wrapped images inside the book. (SVG-wrapped cover is fine, because that's treated specially.)

If you're creating a pure EPUB, or designing the EPUB for personal use, then you may want to use the SVG wrapper.

Quote:
Originally Posted by hobnail View Post
I've never seen this done so I'm assuming that the advantages aren't there.
It's done occassionally. There's even a whole Sigil plugin dedicated towards it:

InsertImageSVG

You rarely see it because people are usually designing books for max compatibility across devices (plus conversion to Kindle).

SVG Wrappers also have some other advantages such as "keeping image and caption together", like RbnJrg has written about many times over the years (especially his Post #5):

https://www.mobileread.com/forums/sh...d.php?t=314639

Last edited by Tex2002ans; 02-25-2020 at 11:31 PM.
Tex2002ans is offline   Reply With Quote
Old 02-26-2020, 05:03 PM   #5
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: 73,987
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Turtle91 View Post
SVG wrapped images will be able to fill the screen without distorting the aspect ratio. Great for full page images like cover/title/maps.
Sorry, but that is incorrect. SVG wrapped images can have the wrong aspect ration very easily.

The default of Calibre is to make the cover full screen even if that is not aspect ratio correct. You have to change the option to make it the correct aspect ratio.
JSWolf is offline   Reply With Quote
Advert
Old 02-26-2020, 06:24 PM   #6
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: 35,428
Karma: 145525534
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by JSWolf View Post
Sorry, but that is incorrect. SVG wrapped images can have the wrong aspect ration very easily.

The default of Calibre is to make the cover full screen even if that is not aspect ratio correct. You have to change the option to make it the correct aspect ratio.
As long as the image size is specified correctly and the code included 'preserveAspectRatio="xMidYMid meet"', I've never seen an SVG wrapped image use an incorrect aspect ratio. Fail to fill the screen yes since the image aspect ratio may not be the same as the screen aspect ratio.
DNSB is offline   Reply With Quote
Old 02-26-2020, 07:21 PM   #7
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: 73,987
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by DNSB View Post
As long as the image size is specified correctly and the code included 'preserveAspectRatio="xMidYMid meet"', I've never seen an SVG wrapped image use an incorrect aspect ratio. Fail to fill the screen yes since the image aspect ratio may not be the same as the screen aspect ratio.
You don't actually need preserveAspectRatio="xMidYMid meet" as that is the default.

Covers don't fill the screen (in most cases) because of the aspect of pBooks vs. the aspect of Readers, Also, given that pBooks aspect has gotten taller, the cover will fill even less of the screen.
JSWolf is offline   Reply With Quote
Old 02-26-2020, 09:31 PM   #8
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: 35,428
Karma: 145525534
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by JSWolf View Post
You don't actually need preserveAspectRatio="xMidYMid meet" as that is the default.

Covers don't fill the screen (in most cases) because of the aspect of pBooks vs. the aspect of Readers, Also, given that pBooks aspect has gotten taller, the cover will fill even less of the screen.
Yes, Jon, I know it's the default. I also know that I've seen too many ebooks where it's been set to "none" or other equally useless for my purposes value. Hence when I start editing an ebook, I run a saved search to set it to "xMidYMid" just to save me from having to re-edit. It is a waste of bytes but I think I still have enough gigabytes of storage that wasting 4 or 5 compressed bytes doesn't concern me.

As for your second point, considering the number of ebooks that do not have a pbook variant but still use a 16:9 or higher aspect ratio for the cover image, I'm not sure if the pbook aspect ratio has much if anything to do with the odd choices used by whomever created the cover image. I tend to suspect that they wanted the cover image to fill a 16:9 or 16:10 phone/tablet display. As the 18-19.5:9 phone displays get more common, I suspect we will find more covers sized to fit those displays.

And here we are with our humble eInk ereaders with a 4:3 (though I've seen one referred to as having a 12:9) aspect ratio.
DNSB is offline   Reply With Quote
Old 02-27-2020, 03:16 AM   #9
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: 73,987
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by DNSB View Post
Yes, Jon, I know it's the default. I also know that I've seen too many ebooks where it's been set to "none" or other equally useless for my purposes value. Hence when I start editing an ebook, I run a saved search to set it to "xMidYMid" just to save me from having to re-edit. It is a waste of bytes but I think I still have enough gigabytes of storage that wasting 4 or 5 compressed bytes doesn't concern me.

As for your second point, considering the number of ebooks that do not have a pbook variant but still use a 16:9 or higher aspect ratio for the cover image, I'm not sure if the pbook aspect ratio has much if anything to do with the odd choices used by whomever created the cover image. I tend to suspect that they wanted the cover image to fill a 16:9 or 16:10 phone/tablet display. As the 18-19.5:9 phone displays get more common, I suspect we will find more covers sized to fit those displays.

And here we are with our humble eInk ereaders with a 4:3 (though I've seen one referred to as having a 12:9) aspect ratio.
The reason I mentioned not needing preserveAspectRatio="xMidYMid meet" is that if you are editing an SVG wrapper and cannot remember the correct form, you can just remove it.
JSWolf is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to show books with only 1 tag? Dynamic tag or virtual library? cd2013 Calibre 4 03-01-2019 06:41 PM
How to keep a Header and svg wrapped img on the same page nodestar ePub 8 05-08-2017 08:05 PM
svg image inside span tag in mobi file not display numbers Hala Aly Workshop 3 09-12-2012 08:00 AM
HTML Meta tag for cover image URL? MrPLD Conversion 5 01-29-2012 12:15 AM
img tag question.. scott.a.andrew ePub 9 02-18-2010 02:38 PM


All times are GMT -4. The time now is 01:39 PM.


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