MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   ePub (https://www.mobileread.com/forums/forumdisplay.php?f=179)
-   -   problems making an image a hyperlink in epub (https://www.mobileread.com/forums/showthread.php?t=316710)

klgc 04-17-2019 04:35 PM

problems making an image a hyperlink in epub
 
Discovering that images inserted with Sigil weren't scaling properly in iBooks, you fine folks here helped me correct the issue so that now I'm using the sample code:

<div style="text-align: center; padding: 0pt; margin: 0pt;">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="width:100%; max-width:100%; height:auto; max-height:100%;" version="1.1" viewBox="0 0 600 525" preserveAspectRatio="xMidYMid meet">
<image width="600" height="525" xlink:href="../Images/C01Ilus01.png"/>
</svg>
</div>

Moving on, I want to add an index of illustrations. I've done so in my NeoOffice master file, but am having problems in my epub file. I can link to an image from the index I created and from the image back to the index in the NeoOffice (.odt) master. It's simply a matter of wrapping an <img ...> tag in an <a ...> tag. However, in my epub I can't seem to make an image a hyperlink to get back to the index.

So far I've tried wrapping various tags within the above sample code with:

<a href="../Text/cEM03.xhtml#c0101ie” id=“c0101”>
. . .
</a>

all to no avail. Is there a way to make an image displayed with the sample code a clickable hyperlink?

Thank you :-)

klgc 04-18-2019 12:30 AM

Seems I got something to work. Studying the confusing W3C SVG Links page at:
https://www.w3.org/wiki/SVG_Links
I came up with the expanded sample code for inserted images (the red is what I added):

<div style="text-align: center; padding: 0pt; margin: 0pt;">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="width:100%; max-width:100%; height:auto; max-height:100%;" version="1.1" viewBox="0 0 600 525" preserveAspectRatio="xMidYMid meet">
<a xlink:href="../Text/cEM03.xhtml#c0101ie" xlink:title="Click image to return to illustrations index" id="c0101">
<image width="600" height="525" xlink:href="../Images/C01Ilus01.png"/>
</a>
</svg>
</div>

It works fine in iBooks and Calibre ebook-viewer on my Mac (Apple is updating my iPad this evening so I'll have to wait to test there), including the tool tip (see xlink:title=". . ." above), though in ADE the tool tip doesn't show but the linking works.

If you have any thoughts about how this may cause issues that I haven't discovered, please speak up :-)

Thank you


PS: I understand why some don't like using an image for a clickable link, and that's why I included a tool tip. Even if a reader inadvertently clicks an image before the tool tip comes up, they're positioned in the illustration index to immediately jump back to where they were.

DiapDealer 04-18-2019 09:56 AM

Quote:

Originally Posted by klgc (Post 3832794)
PS: I understand why some don't like using an image for a clickable link, and that's why I included a tool tip. Even if a reader inadvertently clicks an image before the tool tip comes up, they're positioned in the illustration index to immediately jump back to where they were.

It's much more involved than "not liking it." Images as links just don't work with some EPUB rendering engines. Same with tool tips.

Notjohn 04-18-2019 12:14 PM

And how would the reader KNOW the image is a hotlink? Would it actually say "Click Me"?

BetterRed 04-18-2019 06:14 PM

Quote:

Originally Posted by Notjohn (Post 3833003)
And how would the reader KNOW the image is a hotlink? Would it actually say "Click Me"?

I've seen it done by putting a blue border around the image, not in an epub though, on a now defunct forum engine, seemed a good idea at the time.

BR

klgc 04-18-2019 11:48 PM

Quote:

Originally Posted by DiapDealer (Post 3832944)
It's much more involved than "not liking it." Images as links just don't work with some EPUB rendering engines. Same with tool tips.

True enough :-) The tool tip not working in ADE was an annoyance, but now having had a chance to test the epub on my iPad, I found that in the IOS version of iBooks the link from the index back to the illustration didn't function, which is a deal breaker. So now I'm working on another approach.

As with having to go the SVG route because illustrations weren't resized correctly in some major readers/apps, the underlying problem is that there is no industry wide consensus [i.e. understanding/respect/whatever] for even the standards that are in place. That, of course, is aggravated by older readers/apps, but applies to the current range of available readers/apps. If one gets beyond simple text, sooner or later they're going to find that some of the intended functionality fails in some number of readers/apps. Such may be ok with some tech people, and some businesses, but it's a real pita for authors.

:thanks:

DiapDealer 04-19-2019 11:37 AM

Quote:

Originally Posted by klgc (Post 3833219)
the underlying problem is that there is no industry wide consensus [i.e. understanding/respect/whatever] for even the standards that are in place. That, of course, is aggravated by older readers/apps, but applies to the current range of available readers/apps. If one gets beyond simple text, sooner or later they're going to find that some of the intended functionality fails in some number of readers/apps. Such may be ok with some tech people, and some businesses, but it's a real pita for authors.

Welcome. Some people take much longer to come to this realization. ;)

Notjohn 04-23-2019 05:15 PM

Quote:

Originally Posted by BetterRed (Post 3833124)
I've seen it done by putting a blue border around the image, not in an epub though, on a now defunct forum engine, seemed a good idea at the time.

BR

Probably more people read on tablets and phones today than use e-ink e-readers. Still, there'd be a significant minority who wouldn't see that blue border.

Hitch 04-26-2019 11:55 AM

Quote:

Originally Posted by klgc (Post 3833219)
True enough :-) The tool tip not working in ADE was an annoyance, but now having had a chance to test the epub on my iPad, I found that in the IOS version of iBooks the link from the index back to the illustration didn't function, which is a deal breaker. So now I'm working on another approach.

As with having to go the SVG route because illustrations weren't resized correctly in some major readers/apps, the underlying problem is that there is no industry wide consensus [i.e. understanding/respect/whatever] for even the standards that are in place. That, of course, is aggravated by older readers/apps, but applies to the current range of available readers/apps. If one gets beyond simple text, sooner or later they're going to find that some of the intended functionality fails in some number of readers/apps. Such may be ok with some tech people, and some businesses, but it's a real pita for authors.

:thanks:

Aggravated by "older readers/apps," hell. Look right at Apple when you say that. Nobody ignores the standards quite like they do, or invests so much effort in bending them to their will--more multimedia than actual functionality.

Quote:

Originally Posted by DiapDealer (Post 3833381)
Welcome. Some people take much longer to come to this realization. ;)

Indeedy.

Quote:

Originally Posted by Notjohn (Post 3834991)
Probably more people read on tablets and phones today than use e-ink e-readers. Still, there'd be a significant minority who wouldn't see that blue border.

Oh, horse manure. Firstly, I doubt that any company in the world has that data; the only one that comes close is Amazon, most likely. I'd guess that it's a push. Sure, people read on smartphones, because they have them in their hands, or because it's more cost-efficient to have One Device To Rule Them All, than have dedicated ereaders, but as you can see on this forum alone, serious readers almost always have dedicated devices, and of those, they almost all have eInks. Those damn K2s are still out there puttering alone (mine still works, even though it's sadly neglected in favor of my Oasis), although the battery is finally starting to sputter to its eventual end, and they are still bought and sold, mind-bogglingly.

I suspect that Amazon's sold more eInks than they'll ever admit. I mean, c'mon, you think that they keep coming out with eInks out of sentimentality? No, brother. They come out with them because they sell like crazy.

Hitch

DiapDealer 04-27-2019 11:39 AM

Quote:

Originally Posted by Hitch (Post 3836120)
but as you can see on this forum alone, serious readers almost always have dedicated devices, and of those, they almost all have eInks.

I don't think that's as true as it once was. I can't speak for the world at large, but I can certainly witness a change on these boards. More and more serious readers read on tablets/phones all the time (and not just in a pinch). I'm sure a majority of members still have dedicated eink devices, but we've certainly crossed the rubicon where a reader's "seriousness" gets to be called into question based on the screen technology of their primary reading device. Eink purists are about like pbook purists in that regard: a novelty that serious readers in general don't really have much time for. They just read. *shrug* I suspect the ereading world at large is changing similarly.

Hitch 04-27-2019 01:05 PM

Quote:

Originally Posted by DiapDealer (Post 3836977)
I don't think that's as true as it once was. I can't speak for the world at large, but I can certainly witness a change on these boards. More and more serious readers read on tablets/phones all the time (and not just in a pinch). I'm sure a majority of members still have dedicated eink devices, but we've certainly crossed the rubicon where a reader's "seriousness" gets to be called into question based on the screen technology of their primary reading device. Eink purists are about like pbook purists in that regard: a novelty that serious readers in general don't really have much time for. They just read. *shrug* I suspect the ereading world at large is changing similarly.

Hell, D, I read on smartphones when I'm out and about. I confess, even though I have a larger smartphone (Samsung Note 9 or 10, I can never remember the number, just got it 3 months ago), but I very much prefer more words on the line. To me, reading on a smartphone--with the age of my eyes, that's a caveat--makes the lines too short, and it triggers that thing with lines far shorter than 60-66 characters/line. I guess if you're 18, it's fine, b/c you can make the font a crapload smaller.

Let me rephrase my answer--I don't think that anyone or any company knows the answer to that. Too diverse, too disparate, too many peoples and devices of various types. I tend to run a running poll of my customers. Now, frankly, MOST of my customers aren't eReaders--a fact that always makes me sad (not because I give a hoot, but because it makes MY job so much harder...), but of those that are, it's heavily majority eInks. Could it be that they're a segment of the population that bought eReaders early on, and don't upgrade? I guess, sure.

I tend to harken back to the "golden number" (yup, in typography too) for line-lengths, and there're reasons for it. On smartphones, it's very hard to reach that number. That's kinda the fundamental reason for my thinking. (Not that that impacts real tablets, of course. I have a Kindle Fire 10", which is actually a pretty decent tablet, although I HATE where they put the damn buttons for all the functions.) The golden number exists due to physiological reactions, to eye-flicks, at the end of the line, before the eye lands on the next line. I suspect that reading on the much-shorter line-length smartphones triggers the physiological reaction to those muc-shorter lines. {shrug}. That's my thinking.

Hitch

DiapDealer 04-27-2019 05:05 PM

Quote:

Originally Posted by Hitch (Post 3837036)
but I very much prefer more words on the line. To me, reading on a smartphone--with the age of my eyes, that's a caveat--makes the lines too short, and it triggers that thing with lines far shorter than 60-66 characters/line. I guess if you're 18, it's fine, b/c you can make the font a crapload smaller.

I'm the same. I'll read on my phone in a pinch, but when I'm home ... these 53 year-old eyes can (and do) read all day long on a 10" tablet! My eink devices were transferred to the Gig-Bag-of-Antiquated-Electronics-that-Resides-in-the-Bottom-of-the-Closet a long, long, time ago. My father's 86 and his main reading device has been a 10" Asus tablet for over a year. Can't even get him to look at his eink kindle any more.

Turtle91 04-27-2019 06:58 PM

I guess I'm not sure why the "golden number" would apply to reading devices. I get how it applies to pictures...as in, I understand the concept... but I've seen great pics that don't conform to that rule. I think it is more a training aid to get the photographer to think about composition...

I don't see how getting up to 60-66 characters on a line really makes a difference??

I use my phone to read, exclusively. I typically have it in landscape, but that is so the tables that are often in the books display nicely. It feels like the same width as an old style paperback book - maybe even a little wider. Although, my eyes have reached that 42+ years old range ;) and I find myself making the font a little larger, I don't notice that there are fewer characters on the line. I just get to the end and my eyes move to the next line. I also use auto-scroll so I don't worry about page flipping/swiping. I don't notice anything until I get to the end of a chapter... unless, of course there is some atrocious grammar/spelling that jars me out of the story.

FWIW, I counted the number of characters in a line and it is about 45-50.

BetterRed 04-27-2019 07:35 PM

Maybe its a locality thing, but I'm sure I see more gen-Z's reading p-books than I saw a few years ago. This is borne out by one of the librarians at my local bricks & mortar library who has said he's noticed the same thing with borrowing.

And they're building a new B&M library, and another regular bookshop opened recently.

BR

Turtle91 04-27-2019 08:01 PM

Quote:

Originally Posted by BetterRed (Post 3837144)
Maybe its a locality thing, but I'm sure I see more gen-Z's reading p-books than I saw a few years ago. This is borne out by one of the librarians at my local bricks & mortar library who has said he's noticed the same thing with borrowing.

And they're building a new B&M library, and another regular bookshop opened recently.

BR

I'm always for more people enjoying reading - whatever the format! I get discouraged when a couple of my kids aren't book-nerds :bookworm: like me (luckily the other 6 are!)

I also think it's awesome to have B&M book stores. I like browsing for my next good book...I just hope the new stores closely integrate buying ebooks when you find a good one.

My dream: Lots of aisles - with good book organization, a good hot chocolate stand in the corner, plush chairs to sit in...and a barcode or something that the store's app on my device can scan and automatically purchase/download to my reading software of choice.... :D


All times are GMT -4. The time now is 10:30 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.