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

Can not load a book from manifest.json #822

Closed
miendinh opened this issue Sep 12, 2018 · 15 comments
Closed

Can not load a book from manifest.json #822

miendinh opened this issue Sep 12, 2018 · 15 comments

Comments

@miendinh
Copy link

miendinh commented Sep 12, 2018

I tried epub.js 0.3.66 with this examples

  1. https://github.com/futurepress/epub.js/blob/master/examples/manifest.html
  2. https://s3.amazonaws.com/epubjs-manifest/examples/manifest.html?href=https://readium2.now.sh/pub/L2hvbWUvbm93dXNlci9zcmMvbWlzYy9lcHVicy9jaGlsZHJlbnMtbGl0ZXJhdHVyZS5lcHVi/manifest.json

they seem not to work and don't show any error logs.

are there any bugs in v.0.3.66 ?

thanks

@miendinh miendinh changed the title Can not load book from manifest.json Can not load a book from manifest.json Sep 12, 2018
@danielweck
Copy link

Note that the latest "Readium webpub manifest" specification introduced a breaking change: 'spine' was renamed 'readingOrder' (to align with W3C Web Publications)

The r2-streamer-js server generates this new syntax, so every existing reading system (such as EPUBjs) that implements support for the Readium JSON manifest must update their code accordingly.

Could this be the root cause of the problem here?

CC @JayPanoz

@danielweck
Copy link

Yes, it looks like the EPUBjs code looks for 'spine' instead of 'readingOrder' when parsing the manifest JSON:

'this.spine = json.spine.map( ... )'

https://github.com/futurepress/epub.js/blob/v0.4/src/epub/packaging.js

@danielweck
Copy link

CC @HadrienGardeur

Note that the 'webpub-viewer' demo must be updated too:

'manifest.spine.map( ... )'

https://github.com/HadrienGardeur/webpub-viewer/blob/master/viewer.js.

@danielweck
Copy link

@jccr is the EvidentPoint reader up to date with respect to the 'spine' vs. 'readingOrder' renaming?

@danielweck
Copy link

@jccr
if I am not mistaken you guys rely on the TypeScript ta-json (de)serialisation framework from r2-shared-js models, so you should "automatically" be up to date next time you synchronize with the upstream code.

https://github.com/evidentpoint/r2-shared-js/blob/develop/src/models/publication.ts

https://github.com/evidentpoint/r2-navigator-web/blob/master/src/streamer/publication.ts

@danielweck
Copy link

Fred (@futurepress), sorry to populate this issue with a global status update on "webpub manifest" support, but I think it is important that we achieve interoperability across reading systems. My apologies if this is off-the-mark.

@NYPL-Simplified

Same problem here:
'this.spine = manifestJSON.spine'

https://github.com/NYPL-Simplified/webpub-viewer/blob/master/src/Manifest.ts

I think the best move forward is to implement backward-compatible JSON parsing ('spine' and 'readingOrder'), because not all instances of Readium 2 "streamer" serve the updated webpub manifest syntax, and some integrations might still be using an old r2-streamer-js revision.

@HadrienGardeur, what do you think?

@JayPanoz
Copy link

FWIW, that’s what I was going to (temporarily?) do indeed as we’re in server update mode right now and supporting both is not too much overhead – while providing some flexibility just in case we need to roll back for some reason.

@jccr
Copy link

jccr commented Sep 29, 2018

@danielweck
I'm in the process of updating our forks to upstream. Thanks for the heads up.

@fchasen
Copy link
Contributor

fchasen commented Sep 30, 2018

@danielweck - Thanks for bring this to my attention!

I've updated v0.3 & v0.4 to use either manifest.readingOrder or manifest.spine but I still need to figure out if I should rename all the spine related methods / classes. I've always like the term.

Will publish to npm after that is sorted.

@JayPanoz
Copy link

JayPanoz commented Oct 1, 2018

@danielweck done in our NYPL fork, no issue to report – thanks again for helping by mail. 👍

@HadrienGardeur
Copy link

@danielweck I have a lot on my plate right now so I probably won't be able to handle this before a while in my prototype.

If you have the opportunity to handle it before me, I'll definitely accept the PR though.

@danielweck
Copy link

Thanks for the quick fix @fchasen :)

Note that the demo page:
https://s3.amazonaws.com/epubjs-manifest/examples/manifest.html?href=https://readium2.now.sh/pub/L2hvbWUvbm93dXNlci9zcmMvbWlzYy9lcHVicy9jaGlsZHJlbnMtbGl0ZXJhdHVyZS5lcHVi/manifest.json

...has not been updated with the latest code yet:
7fd362b

@danielweck
Copy link

danielweck commented Oct 3, 2018

@danielweck
Copy link

@fchasen
Copy link
Contributor

fchasen commented Oct 14, 2018

Updated the demo, going to close this for now.

Thanks all!

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

No branches or pull requests

6 participants