Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Divina: linkable rectangles in images #84

Open
chocolatkey opened this issue Oct 27, 2021 · 2 comments
Open

Divina: linkable rectangles in images #84

chocolatkey opened this issue Oct 27, 2021 · 2 comments
Labels

Comments

@chocolatkey
Copy link
Member

chocolatkey commented Oct 27, 2021

Japanese manga magazines use HTML/SVG-native <a> elements with <rect>, inside of the <svg> of a fixed layout EPUBs. When loading the EPUBs into a web engine, this feature magically works, given a decent EPUB renderer (feature shown here highlighted by dev tools):
image
The XHTML of this page (taken from a real live EPUB) is available here: https://gist.github.com/chocolatkey/e86d79b43b4450d1bcf75c47b9dad4e2

This lets users easily get to a chapter in the publication, despite there being no HTML table of contents in the spine, which is always the case with e.g. manga.
Proprietary reading solutions in Japan have implemented this feature during conversion to a divina-like format for web, live example here: https://viewer-trial.bookwalker.jp/03/12/viewer.html?cid=9bed8d15-ca00-44d6-bdc0-f5051ee1f4b0&cty=1 . The representation in their JSON looks like this (the LinkList):
image

Another example of a manga reader (for the same publication) that implements this same feature: https://booklive.jp/bviewer/s/?cid=411736_059

I think having this feature in divina would help increase adoption in those situations, and it is not particularly difficult to implement this feature in a web reader (or native one).

@mickael-menu
Copy link
Member

That's a great use case.

I think this could go beyond images and work with any kind of media type (most useful for binary formats of course). For example, an audiobook could have some links to characters description available for each characters in a "scene". For this, a media fragment can determine the duration of the link.

Think of X-Ray by Amazon (available on Kindle but also Prime video).

It reminds me of the discussion on the Synchronized Narration spec, at its core it's pretty similar: a way to map two (or more) locators. In the case of Synchronized Renditions, it is used to synchronize the playback of multiple resources, while here it is to display links. Maybe there's an opportunity for a shared JSON schema.

@HadrienGardeur
Copy link
Collaborator

First of all, aside from an implementation using SVG, I believe that this can also be implemented in HTML with image maps.
Image maps have also been mentioned in the context of a11y for FXL as they also allow to associate text to areas of an image.

In the case of Divina, where we don't use HTML or SVG at all, I think that this can be implemented using a similar approach.
For example:

{
  "href": "http://example.org/page1.jpeg",
  "type": "image/jpeg",
  "map": [
    {
      "href": "#xywh=0,0,300,200",
      "title": "Panel 1"
    },
    {
      "href": "#xywh=300,200,310,200",
      "title": "Panel 2"
    }
  ]
}

This would open a number of questions of course:

  • do we need a new link property (map) or can we re-use an existing one (children)?
  • since href is used to define the area, how do we handle their destination when they have one?
  • how do we handle areas that overlap one another?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants